Bounces handling is off to a great start!
We set up Amazon SES with email feedback and Mautic properly fetches the bounced email (note, console below sanitized):
Code:
me@server:~/www/mautic/app$ php console mautic:fetch:email --env=prod
1 emails processed for {mail..com:143/imap/tls/novalidate-cert}INBOX_email@server.com
However, in the reports in Mautic we still see 0 failed and the email message that should have failed is shown as 'not read'
Since it properly parsed the failed delivery email, not sure what is wrong. Anything else I should do to debug?
@ramez_rafla Thanks man! I (and I’m sure the rest of the Mautic community as well) really appreciate your work. Would you be so kind and write the Amazon SES setup to the docs? I have no experience with it. The documentation has also a GitHub repo:
https://github.com/mautic/documentation
Just to make the info about this issue complete, the PR is here: https://github.com/mautic/mautic/pull/1021
Bounces handling is off to a great start!
We set up Amazon SES with email feedback and Mautic properly fetches the bounced email (note, console below sanitized):
me@server:~/www/mautic/app$ php console mautic:fetch:email --env=prod
1 emails processed for {mail.<server>.com:143/imap/tls/novalidate-cert}INBOX_email@server.com
However, in the reports in Mautic we still see 0 failed and the email message that should have failed is shown as ‘not read’
Since it properly parsed the failed delivery email, not sure what is wrong. Anything else I should do to debug?
Solved it! thanks to Eclipse and PDT.
The body parsing rules are out of date (2 years-old) and don’t catch Amazon SES’s bounce email
Please add this rule to EmailBundle/Helper/MessageHelper.php, function [b]parseBody/b
/*
* rule: mailbox error (Amazon SES);
* sample:
* An error occurred while trying to deliver the mail to the following recipients:
* xxxxx@yourdomain.com
*/
elseif (preg_match("/ans+errors+occurreds+whiles+tryings+tos+delivers+thes+mails+tos+thes+followings+recipients:rns*(S+@S+w)/is", $body, $match)) {
$result['rule_cat'] = 'unknown';
$result['rule_no'] = '0013';
$result['bounce_type'] = 'hard';
$result['remove'] = 1;
$result['email'] = $match[1];
// for some reason, the text 'Reporting-MTA' gets attached at the end of the email addresss
$result['email'] = preg_replace("/Reporting-MTA/","",$result['email']);
}
@escopecz
PR created for MessageHelper.php, as well, a bug in one of the calls was identified (flipped argument order).
Thanks for accepting this PR so we can use Amazon SES.
Explanations in the docs on how to setup Amazon SES with feedback emails would help the community, your users and make Mautic stand out vs. Sendy as the solution of choice for full marketing automation with SES.
Thanks