# SES with SNS Bounce not working

**URL:** <https://forum.mautic.org/t/ses-with-sns-bounce-not-working/12348>\
**Category:** Product Support\
**Created:** [January 17, 2020, 10:24pm UTC](https://forum.mautic.org/t/ses-with-sns-bounce-not-working/12348 "2020-01-17T22:24:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hansadler](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/hansadler/32/902_2.png) [@hansadler](https://forum.mautic.org/u/hansadler)\
**Post date:** [January 17, 2020, 10:24pm UTC](https://forum.mautic.org/t/ses-with-sns-bounce-not-working/12348/1 "2020-01-17T22:24:39Z")

</div>

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](https://www.mautic.org/docs/en/emails/bounce_management.html)  
I configured SNS with the callback https://\<[mymauticdomain.com](http://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](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!

---

<div class="post-metadata">

**Author:** ![autoize](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/autoize/32/105_2.png) [@autoize](https://forum.mautic.org/u/autoize)\
**Post date:** [January 17, 2020, 10:44pm UTC](https://forum.mautic.org/t/ses-with-sns-bounce-not-working/12348/2 "2020-01-17T22:44:27Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![hansadler](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/hansadler/32/902_2.png) [@hansadler](https://forum.mautic.org/u/hansadler)\
**Post date:** [January 18, 2020, 9:32pm UTC](https://forum.mautic.org/t/ses-with-sns-bounce-not-working/12348/3 "2020-01-18T21:32:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![autoize](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/autoize/32/105_2.png) [@autoize](https://forum.mautic.org/u/autoize)\
**Post date:** [January 18, 2020, 10:33pm UTC](https://forum.mautic.org/t/ses-with-sns-bounce-not-working/12348/4 "2020-01-18T22:33:42Z")

</div>

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](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mailbox-simulator.html) to test will prevent your bounces from counting against your sender reputation metrics.

---

<div class="post-metadata">

**Author:** ![MxyzptlkFishStix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mxyzptlkfishstix/32/1132_2.png) [@MxyzptlkFishStix](https://forum.mautic.org/u/MxyzptlkFishStix)\
**Post date:** [January 19, 2020, 5:04am UTC](https://forum.mautic.org/t/ses-with-sns-bounce-not-working/12348/5 "2020-01-19T05:04:20Z")

</div>

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