Mautic Community Forums

SES with SNS Bounce not working

My Mautic version is: 2.16.0-dev
My PHP version is: 7.1.33

My problem is:
I followed the instructions here: https://www.mautic.org/docs/en/emails/bounce_management.html
I configured SNS with the callback https://<mymauticdomain.com>/mailer/amazon/callback
Then tested a new campaign with a segment that contains some invalid email addresses, but got nothing in my “bounced” segment.

It seems like the callback url does not work. https://sender.wingboat.com/mailer/amazon/callback
I did a curl with that url and got the “Uh oh! I think I broke it.” message.
These errors are showing in the log:

My apache access log shows that there was a 500 error for that request.

Any pointers? Thanks!

This means that there is a problem with your Mautic instance, perhaps due to how it was installed or a failed update in the past. Can you find more details about the 500 error by looking in the Mautic error log located at app/logs folder. There should be a log file generated with the date of the error - maybe more than one. If there is a log file marked with prod, be sure to check it as well.

Does the SNS topic show as Confirmed in the SNS dashboard?

Also, have you associated the SNS topic with the SES sending domain for Bounce and Complaint events?

Hello.

Yes, the SNS topic shows as confirmed in the SNS dashboard.
Yes, I associated the SNS topic with the SES sending domain for Bounce.

I see this in the logs, but not sure if it’s related to my problem.

mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/html/mautic/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php - at line 86 {“maxlifetime”:1440}

Thanks for your help

Can you try fixing the session store issue and testing the bounces again?
This error message means that the session store directory /var/lib/php/sessions is owned by the incorrect user, which can sometimes happen after updating PHP.

If you are running Apache on Ubuntu, your web server user is most likely www-data. Apache on CentOS/RHEL runs as the apache user. Here is an example of a command to correct the ownership of the session store.

sudo chown -R apache:apache /var/lib/php/sessions

Hint: Using the Amazon SES Mailbox Simulator to test will prevent your bounces from counting against your sender reputation metrics.

Make sure Service to send mail through is set to Amazon SES and not Other SMTP Server.