-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
-
-
Yes
-
Empty show more show less
The pattern is used in info.magnolia.module.mail.templates.MgnlEmail.setFrom(String). If you call e.g. setFrom("Felix Rabe <felix.rabe@magnolia-cms.com>") which is completely valid, it will go down the "else" branch, as the regular expression does not match anything without '"'s or anything with a whitespace before "<".
I propose to shorten the code to just:
public void setFrom(String _from) { try { InternetAddress address = new InternetAddress(_from, True); this.setFrom(address); } catch (Exception e) { log.error("Could not set from field of email:" + e.getMessage()); } }
and remove the wrong pattern altogether.
Acceptance criteria
- clones
-
MGNLMAIL-49 info.magnolia.module.mail.templates.MgnlEmail.EMAIL_WITH_PERSONAL_PATTERN is wrong and superfluous
- Closed