SES Bounces not working

I have SES and SNS configured. Bounce cron job is running and mailbox is setup.



If I send and email from Mautic to the SES test email account (bounce@simulator.amazonses.com) the bounce notification hits my mailbox and the cron job processes the bounce and marks the lead with the “Email bounced” tag.



If I send an email from Mautic to a non-existing email account the bounce notification from SNS hits my mailbox and the cron job processes the bounce email but the lead does not get marked with the “Email bounced” tag.



There are no error messages in the log.



I do see a small difference in the bounce notifications sent from SNS (see below).

Is Mautic not parsing the email correctly or am I doing something wrong?



SNS Bounce email that works:

Code:
{"notificationType":"Bounce","bounce":{"bounceSubType":"General","bounceType":"Permanent","reportingMTA":"dsn; a8-90.smtp-out.amazonses.com","bouncedRecipients":[{"emailAddress":"bounce@simulator.amazonses.com","status":"5.1.1","diagnosticCode":"smtp; 550 5.1.1 user unknown","action":"failed"}],"timestamp":"2016-04-11T17:57:10.056Z","feedbackId":"01000154067854c0-7ef80379-7467-42a0-8ecb-f9c21fdce54b-000000"},"mail":{"timestamp":"2016-04-11T17:57:09.000Z","source":"XXX@mautic.XXX.com","sendingAccountId":"392188122432","messageId":"01000154067851d9-e60318ad-008a-43f3-93ac-5e6973c20639-000000","destination":["bounce@simulator.amazonses.com"],"sourceArn":"arn:aws:ses:us-east-1:392188122432:identity/XXX@mautic.XXX.com"}}


If you wish to stop receiving notifications from this topic, please click or visit the link below to unsubscribe:
https://sns.us-east-1.amazonaws.com/unsubscribe.html?SubscriptionArn=arn:aws:sns:us-east-1:392188122432:m_bounces:36104cdf-aa1b-45de-8f5f-bd522df22eae&Endpoint=XXX@mautic.XXX.com

Please do not reply directly to this email. If you have any questions or comments regarding this email, please contact us at https://aws.amazon.com/support


SNS Bounce email that does not work:
Code:
{"notificationType":"Bounce","bounce":{"bounceSubType":"General","bounceType":"Permanent","reportingMTA":"dsn; a8-241.smtp-out.amazonses.com","bouncedRecipients":[{"action":"failed","emailAddress":"jimmyd0u812@gmail.com","status":"5.1.1","diagnosticCode":"smtp; 550-5.1.1 The email account that you tried to reach does not exist. Please tryn550-5.1.1 double-checking the recipient's email address for typos orn550-5.1.1 unnecessary spaces. Learn more atn550 5.1.1 https://support.google.com/mail/answer/6596 q141si21180496qha.77 - gsmtp"}],"timestamp":"2016-04-11T18:15:03.031Z","feedbackId":"010001540688b3f2-36ab9783-3941-431c-ad4b-9916390db8f9-000000"},"mail":{"timestamp":"2016-04-11T18:15:02.000Z","sourceArn":"arn:aws:ses:us-east-1:392188122432:identity/XXX@mautic.XXX.com","source":"XXX+bounce_570be98377160@mautic.XXX.com","messageId":"010001540688b0ee-4a49750b-2838-4b5d-9de4-7ef3082c58a8-000000","destination":["jimmyd0u812@gmail.com"],"sendingAccountId":"392188122432"}}


If you wish to stop receiving notifications from this topic, please click or visit the link below to unsubscribe:
https://sns.us-east-1.amazonaws.com/unsubscribe.html?SubscriptionArn=arn:aws:sns:us-east-1:392188122432:m_bounces:36104cdf-aa1b-45de-8f5f-bd522df22eae&Endpoint=XXX@mautic.XXX.com

Please do not reply directly to this email. If you have any questions or comments regarding this email, please contact us at https://aws.amazon.com/support

I have SES and SNS configured. Bounce cron job is running and mailbox is setup.

If I send and email from Mautic to the SES test email account (bounce@simulator.amazonses.com) the bounce notification hits my mailbox and the cron job processes the bounce and marks the lead with the “Email bounced” tag.

If I send an email from Mautic to a non-existing email account the bounce notification from SNS hits my mailbox and the cron job processes the bounce email but the lead does not get marked with the “Email bounced” tag.

There are no error messages in the log.

I do see a small difference in the bounce notifications sent from SNS (see below).
Is Mautic not parsing the email correctly or am I doing something wrong?

SNS Bounce email that works:

{"notificationType":"Bounce","bounce":{"bounceSubType":"General","bounceType":"Permanent","reportingMTA":"dsn; a8-90.smtp-out.amazonses.com","bouncedRecipients":[{"emailAddress":"bounce@simulator.amazonses.com","status":"5.1.1","diagnosticCode":"smtp; 550 5.1.1 user unknown","action":"failed"}],"timestamp":"2016-04-11T17:57:10.056Z","feedbackId":"01000154067854c0-7ef80379-7467-42a0-8ecb-f9c21fdce54b-000000"},"mail":{"timestamp":"2016-04-11T17:57:09.000Z","source":"XXX@mautic.XXX.com","sendingAccountId":"392188122432","messageId":"01000154067851d9-e60318ad-008a-43f3-93ac-5e6973c20639-000000","destination":["bounce@simulator.amazonses.com"],"sourceArn":"arn:aws:ses:us-east-1:392188122432:identity/XXX@mautic.XXX.com"}}

--
If you wish to stop receiving notifications from this topic, please click or visit the link below to unsubscribe:
https://sns.us-east-1.amazonaws.com/unsubscribe.html?SubscriptionArn=arn:aws:sns:us-east-1:392188122432:m_bounces:36104cdf-aa1b-45de-8f5f-bd522df22eae&Endpoint=XXX@mautic.XXX.com

Please do not reply directly to this email. If you have any questions or comments regarding this email, please contact us at https://aws.amazon.com/support

SNS Bounce email that does not work:

{"notificationType":"Bounce","bounce":{"bounceSubType":"General","bounceType":"Permanent","reportingMTA":"dsn; a8-241.smtp-out.amazonses.com","bouncedRecipients":[{"action":"failed","emailAddress":"jimmyd0u812@gmail.com","status":"5.1.1","diagnosticCode":"smtp; 550-5.1.1 The email account that you tried to reach does not exist. Please tryn550-5.1.1 double-checking the recipient's email address for typos orn550-5.1.1 unnecessary spaces. Learn more atn550 5.1.1  https://support.google.com/mail/answer/6596 q141si21180496qha.77 - gsmtp"}],"timestamp":"2016-04-11T18:15:03.031Z","feedbackId":"010001540688b3f2-36ab9783-3941-431c-ad4b-9916390db8f9-000000"},"mail":{"timestamp":"2016-04-11T18:15:02.000Z","sourceArn":"arn:aws:ses:us-east-1:392188122432:identity/XXX@mautic.XXX.com","source":"XXX+bounce_570be98377160@mautic.XXX.com","messageId":"010001540688b0ee-4a49750b-2838-4b5d-9de4-7ef3082c58a8-000000","destination":["jimmyd0u812@gmail.com"],"sendingAccountId":"392188122432"}}

--
If you wish to stop receiving notifications from this topic, please click or visit the link below to unsubscribe:
https://sns.us-east-1.amazonaws.com/unsubscribe.html?SubscriptionArn=arn:aws:sns:us-east-1:392188122432:m_bounces:36104cdf-aa1b-45de-8f5f-bd522df22eae&Endpoint=XXX@mautic.XXX.com

Please do not reply directly to this email. If you have any questions or comments regarding this email, please contact us at https://aws.amazon.com/support

I will fix it myself if someone could tell me what piece of code is being used for SES bounce emails. So far I love Mautic and don’t want to give up now.

Hi Michael,

I have the exact same issue. So far I have not had any responses to my enquiries either.

Ill keep an eye on my thread and if i get a response - essentially the exact same question - then ill let you know.

PS: I posted my query on March 25th…

Thanks. I fear a response will never come.
I have started looking into implementing the AWS SES SDK. But trying to figure out where to do it in the code is a pain. I know there have been others who have said the same but nobody has done it as far as I know.

I have fixed this in my environment. This fix is for Amazon SES only. Instructions follow…

  1. Disable the Mautic cronjob for handling bounces (no longer needed).
  2. I have created 2 php scripts. One for bounces and one for complaints. I put them in DOCUMENT_ROOT.
  3. If you followed the instructions to create 2 Amazon SNS subscriptions with the Protocol = Email, delete them.
  4. Create a new Amazon SNS subscription for your bounces topic with the Protocol = HTTP or HTTPS and set the end point = to the URL of the bounces script.
  5. Create a new Amazon SNS subscription for your complaints topic with the Protocol = HTTP or HTTPS and set the end point = to the URL of the complaints script.

That’s it. Done and working perfectly. I will provide the 2 scripts for anyone who wants them. Not sure if I should post them here or not. Or where to put them for others.

Thank you michaelbdana,
I did exactly as you describe.
But, the arn http subscription is as “PendingConfirmation”.
Exists some code to confirm? Whats the way?

How can I share them? I cannot attach any files to this post.

You can find a zip file here: https://www.dropbox.com/s/ehalrvkhmowm2rn/Archive.zip?dl=0

Unzip the file and put the certs directory and the 2 scripts in your
document root.

Then set up your Amazon sns subscriptions:

point your complaints topic to https://your.domain/complaints.php
point your bounces topic to https://yourdomain/bounces.php

I’m experiencing the same issues with my mautic not processing SES bounces the traditional way.

Is this solution still the best bet for fixing this?

my fix was a long time ago. I would assume this has been fixed. I have installed new versions of Mautic and don’t seem to have that problem any more.

I would post your problem on the main channel. It’s probably a configuration problem.

Finally I have solved by myself. The problem is that you have to configure de bouncing in SES also for the emails that you use for sending mails… Then everything works fine now.

Hi, would you be able to assist us in getting ours to work - we have been struggling for weeks now to get mautic to acknowledge bounces with no luck.

Our email config is as follows:

  • AWS SES SMTP configured successfully
  • we didnt specify a custom return path (bounce) address
  • monitored inbox settings mapped to the same email address as where we sending emails from

AWS SES settings:

any guidance appreciated
Ilse

any help appreciated?

Hi,
If you use the Amazon SNS bounce notifications, then you don’t need to use monitored inbox settings.
Did you set up the bounce channel in the sender email or identity as well in Amazon SES?

If you have no SNS topic here, then you’ll need to add it!

HI Joey, thanks for reaching out

I have dont quite a bit of testing and trying to figure it out, any advice appreciated:

  1. Following this process 100%: Emails send; cannot get bounce & complaints to show in Mautic.
    Mautic and Amazon SES Setup Tutorial - Send emails using AWS SES - YouTube

  2. Then i tried following this using a new topic, sub setup process. when i send an email from the SES console everything works very well as i can see bounces in cloudwatch, but the moment i send it from the mautic console the mail sends but no bounces are registered. i think i might need to add the Configset into my mail header settings but cannot get this to work i might be doing it wrong: Monitor opens, clicks, and bounces for Amazon SES emails

  3. then i thought let me try this one as a different strategy that might work for my bounces, but still no luck :(. : Send Marketing Emails For Basically Zero Dollars - Mautic + AWS SES - YouTube

i feel like my SES and SNS is doing what it should, but for some reason i have no idea how to tell Mautic when a mail bounced. is my expectation correct that in my email stats the bounced graph should show something right?

Hello!

Are you using SES API or SES SMTP, like Kevin suggested?
Any errors in the logs, for example: “incoming payload cannot be inderstood.”

Joey

Hi Joey,

I have figured out what my issue was.
Using SES SMTP:

  • i only set the notification settings on the verified domain, and not on the verified email address. the moment i added the https endpoint SNS topic to the verified email address too, it started populating the contact “do not contact” labels :slight_smile: yay!

Next step to getting Bounces to work properly, is now figuring out why the Channel > Email > graph doesnt show bounces even though there were confirmed bounces. Any idea on this? i noticed a few bug discussions on github but havent seen a formal resolution?

see screenshot:

Thank you @ilseb for this solution.

Any updates on the bounce graph not working?

Is it a recent send you experience this issue? The timeframe of the stats on this page must include the time when the bounce happened.
Joey