diff --git a/plugins/workflow/tasks/class_tasksMail.inc b/plugins/workflow/tasks/class_tasksMail.inc index 8eeba24518c2c32e63b43ee64d689d54069c9469..e8cf6a684338b401b5791c28decb460c19b5ab2c 100644 --- a/plugins/workflow/tasks/class_tasksMail.inc +++ b/plugins/workflow/tasks/class_tasksMail.inc @@ -189,8 +189,12 @@ class tasksMail extends simplePlugin $info = $ldap->fetch(); if (!empty($info[$mailAttr][0])) { - // In case of private supann mail, remove the prefix - $mailList[] = preg_replace('/.+?(?=supann)/', '', $info[$mailAttr][0]); + + // Remove anything between curly braces (e.g., {PERSO}, {PRO} as well as supann labels) + $cleanMail = preg_replace('/.+?(?=supann)/', '', $info[$mailAttr][0]); + $finalMail = preg_replace('/\{.*?\}/', '', $cleanMail); + + $mailList[] = $finalMail; // Render the mailing list unique, somewhat mandatory when updating the members lists with dynGroups and members. $mailList = array_unique($mailList);