View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0020037||phpList 3 application||Bounce Management||public||01-08-19 20:01||21-08-19 11:15|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Target Version||3.4.5||Fixed in Version||3.4.5|
|Summary||0020037: Failing to identify the email address in a bounce|
|Description||The bounce processing identifies the subscriber from the X-ListMember header. If that is not present then it falls back to looking for any email addresses in the bounce body to see whether they are a subscriber's email address.|
The regex to find email addresses is
preg_match_all('/[\S]+@[\S\.]+/', $text, $regs);
this looks to be too strict as it expects the email address to be surrounded by white space.
Looking at some bounces to see why they were unidentified, they have lines like this, where the email address is surrounded by square brackets
5.1.0 - Unknown address error 550-'5.4.1 [email@example.com]: =
which means that the regex matches '[firstname.lastname@example.org]:' which clearly is not a subscriber's email address.
Without worrying too much about matching all possible email addresses, a regex that will match only the characters of the email address, ignoring any surrounding brackets or white space is
preg_match_all('/[\w\._-]+@[\w\._-]+/', $text, $regs);
|Tags||No tags attached.|