# Mautic 5.0.3 AWS SNS endpoint is not working. GIve a solution to handle bounce and Complaint emails

**URL:** <https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334>\
**Category:** Product Support\
**Created:** [March 19, 2024, 7:00am UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334 "2024-03-19T07:00:32Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![e-tailors\_pm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/e-tailors_pm/32/11642_2.png) [@e-tailors\_pm](https://forum.mautic.org/u/e-tailors_pm)\
**Post date:** [March 20, 2024, 10:23am UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/21 "2024-03-20T10:23:30Z")

</div>

Hi there u can also try to use our extension:

https://github.com/pm-pmaas/etailors\_amazon\_ses

This module manages both the sending of the mails with Amazon SES as well bounce returns by Amazon SNS.

Extension is still in beta so feedback on it is welcome. We have running it at this moment in about 10 installations without known issues at the moment.

---

<div class="post-metadata">

**Author:** ![ldrolez](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@ldrolez](https://forum.mautic.org/u/ldrolez)\
**Post date:** [March 20, 2024, 9:19pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/22 "2024-03-20T21:19:49Z")

</div>

Thanks for your plugin, now I have to generate a bounce to check that everything works 😉

---

<div class="post-metadata">

**Author:** ![shishir](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@shishir](https://forum.mautic.org/u/shishir)\
**Post date:** [March 21, 2024, 7:04am UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/23 "2024-03-21T07:04:23Z")

</div>

Can you share me the steps to do it? Still I am stuck. plugin is not being installed. Please provide a guide how to do this . Should I try with root user or the user I am using in the cpanel.

---

<div class="post-metadata">

**Author:** ![e-tailors\_pm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/e-tailors_pm/32/11642_2.png) [@e-tailors\_pm](https://forum.mautic.org/u/e-tailors_pm)\
**Post date:** [March 21, 2024, 3:58pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/24 "2024-03-21T15:58:27Z")

</div>

Sure, please try to steps below:

**Setup:**

1. Download module from GIT in plugins folder
2. Rename folder name of module to `AmazonSesBundle`
3. Clear cache with `php bin/console cache:clear`

**Configuration e-mail sending**

1. Login to mautic
2. Go to configuration e-mail
3. put in settings from Amazon SES ( Simple e-mail service )
  1. DSN: `mautic+ses+api`
  2. Host: `default`
  3. Username: `From Amazon SES SMTP settings`
  4. Password: `From Amazon SES SMTP settings`
  5. Region: `From Amazon SES`

4. Test if mail sending is working, if not please correct given errors

 ![Scherm­afbeelding 2024-03-21 om 16.47.58](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9493adf965be87873a4daff0fd752b1cac6a674e.png)

**Configuration of SNS callback**

1. Go to Amazon SNS ( Simple notification service )
2. Add topic
3. Add subscription (HTTPS)
4. Add url: `https://yourmauticinstance.com/mailer/callback`
5. Check if subcription is confirmed
6. Go back to Amazon SES (Simple e-mail service )
7. Connect subscription topic
8. Test bounces / compliants etc.

 ![Scherm­afbeelding 2024-03-21 om 16.55.09](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/82c0ec84b0af2233cc5ff50ea44ca02a7663fe87.png)  
 ![Scherm­afbeelding 2024-03-21 om 16.57.35](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/b/b3f27d65cff9472147496fd99ab95e003edf3849.png)

Hope this helps u!

---

<div class="post-metadata">

**Author:** ![shishir](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@shishir](https://forum.mautic.org/u/shishir)\
**Post date:** [March 22, 2024, 4:00am UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/25 "2024-03-22T04:00:14Z")

</div>

Thank you.

---

<div class="post-metadata">

**Author:** ![v11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/v11/32/11629_2.png) [@v11](https://forum.mautic.org/u/v11)\
**Post date:** [April 4, 2024, 8:56pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/26 "2024-04-04T20:56:02Z")

</div>

Hi, thank you for your plugin. I´m receiving the following error in Mautic Logs:

mautic.WARNING: PHP Warning - is\_readable(): open\_basedir restriction in effect. File(/home/manehu/.aws/config) is not within the allowed path(s): (/home/manehu/.composer:/home/manehu/web/mautic.ctrlt.es/public\_html:/home/manehu/web/mautic.ctrlt.es/private:/home/manehu/web/mautic.ctrlt.es/public\_shtml:/home/manehu/tmp:/tmu/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt) - in file /home/manehu/web/mautic.ctrlt.es/public\_html/vendor/aws/aws-sdk-php/src/DefaultsMode/ConfigurationProvider.php - at line 152 {“hostname”:“hestia.ctrlt.es”,“pid”:358391}

¿Can someone help me, please?

 ![Captura de pantalla 2024-04-04 a las 22.54.11](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/7ceed1f610939d511774c46fa80fb779c58ce207.png)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 5, 2024, 5:00am UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/27 "2024-04-05T05:00:22Z")

</div>

Hi you need to install this in the plugins folder, inside Mautic.

---

<div class="post-metadata">

**Author:** ![v11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/v11/32/11629_2.png) [@v11](https://forum.mautic.org/u/v11)\
**Post date:** [April 9, 2024, 9:42am UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/28 "2024-04-09T09:42:34Z")

</div>

Thank you for your response @joeyk.

I belive it is installed in the correct folder:

/home/manehu/web/mautic.ctrlt.es/public\_html/plugins#

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0540a678ea0a70f1f0313ed4d76d83386c5402a9.png)

---

<div class="post-metadata">

**Author:** ![gregy1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gregy1/32/2029_2.png) [@gregy1](https://forum.mautic.org/u/gregy1)\
**Post date:** [May 1, 2024, 8:17pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/29 "2024-05-01T20:17:28Z")

</div>

Hi!

Thank you for the plugin. Sending emails via SES works fine!  
…but SNS not:(  
I did everything according to your instructions but got this log error:

**[2024-05-01T20:09:24.407172+00:00] mautic.WARNING: PHP Warning - Undefined array key “Type” - in file …/plugins/AmazonSesBundle/EventSubscriber/CallbackSubscriber.php - at line 236**

Do you know why or how to handle this problem.  
Even if I send an email to a non existing email address Mautic do not mark this fake contact as DNC.

Kind regards,

Greg

---

<div class="post-metadata">

**Author:** ![e-tailors\_pm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/e-tailors_pm/32/11642_2.png) [@e-tailors\_pm](https://forum.mautic.org/u/e-tailors_pm)\
**Post date:** [May 3, 2024, 9:25pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/30 "2024-05-03T21:25:13Z")

</div>

Hi Gregy1,

In which folder have u installed the Bundle ? Which version of Mautic do u use exactly ?

Please let me know!

Regards Paul

---

<div class="post-metadata">

**Author:** ![pveintimilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pveintimilla/32/11743_2.png) [@pveintimilla](https://forum.mautic.org/u/pveintimilla)\
**Post date:** [May 4, 2024, 2:02am UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/31 "2024-05-04T02:02:27Z")

</div>

Hi,

I have develop a plugin to Mautic 5 to Amazon SES.

You can try in: [GitHub - pabloveintimilla/mautic-amazon-ses: Mautic 5 plugin, provides Amazon SES as an email transport and callback to process bounces]([GitHub - pabloveintimilla/mautic-amazon-ses: Mautic 5 plugin, provides Amazon SES as an email transport and callback to process bounces](https://github.com/pabloveintimilla/mautic-amazon-ses)

To confirm sns suscription check readme of plugin

Regards!

---

<div class="post-metadata">

**Author:** ![gregy1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gregy1/32/2029_2.png) [@gregy1](https://forum.mautic.org/u/gregy1)\
**Post date:** [May 6, 2024, 4:39pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/32 "2024-05-06T16:39:51Z")

</div>

Hello!

Thank you very much for your reply!

To be more precise I took a screenshot of my FTP:

![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/dede5a0244b007b97a88fc02d3be0f600235c4ce.png)

The Bundle is installed in the plugins folder.

Mautic shows the plugin as active:

 ![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/1/1b467ae624a70f50eed72870de0042292c3f1b5f.png)

Sending e-mails via SES works perfect. Here’s a screenshot of Email Settings:

 ![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/da2e728ceafd0d02d1dcfdd24f12709feebe3269.png)

SNS Endpoint is also confirmed:

 ![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/6f5f890638826f91c42db895a0a4886ad0d30bf4.png)

…and all of that is set upon Mautic ver. 5.0.4

![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/058f1c139505981a1cef7c85fa5e3b6898eb3de7.png)

Nevertheless, the SNS for a bounce e-mail creates this entry in Mautic log → **mautic.WARNING: PHP Warning - Undefined array key “Type” - in file …/plugins/AmazonSesBundle/EventSubscriber/CallbackSubscriber.php - at line 236**

Is there any help for me with this?

😭

P.S. My instance is on shared hosting.

---

<div class="post-metadata">

**Author:** ![gregy1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gregy1/32/2029_2.png) [@gregy1](https://forum.mautic.org/u/gregy1)\
**Post date:** [May 6, 2024, 4:48pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/33 "2024-05-06T16:48:38Z")

</div>

You may need to try 2465 port instead of 465.

![obraz](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/986843d32f3ae1de9192f65d278c10da113ce7a5.png)

It worked with me.

---

<div class="post-metadata">

**Author:** ![e-tailors\_pm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/e-tailors_pm/32/11642_2.png) [@e-tailors\_pm](https://forum.mautic.org/u/e-tailors_pm)\
**Post date:** [May 16, 2024, 2:33pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/34 "2024-05-16T14:33:02Z")

</div>

so everything is working now with the plugin ( sending + SNS callback ) ??

---

<div class="post-metadata">

**Author:** ![gregy1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gregy1/32/2029_2.png) [@gregy1](https://forum.mautic.org/u/gregy1)\
**Post date:** [May 16, 2024, 7:37pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/35 "2024-05-16T19:37:35Z")

</div>

No…the problem with bounces and SNS still exists.

This log entry keeps showing all the time when Mautic sends an e-mail on a bounce address:

→ **mautic.WARNING: PHP Warning - Undefined array key “Type” - in file …/plugins/AmazonSesBundle/EventSubscriber/CallbackSubscriber.php - at line 236**

☹

---

<div class="post-metadata">

**Author:** ![e-tailors\_pm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/e-tailors_pm/32/11642_2.png) [@e-tailors\_pm](https://forum.mautic.org/u/e-tailors_pm)\
**Post date:** [May 17, 2024, 10:04am UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/36 "2024-05-17T10:04:00Z")

</div>

> [@gregy1](#):
>
> CallbackSubscriber

Please check if you have the code below in the file:

> eventSubscriber/CallbackSubscriber.php

somewhere arround

> line2 34

```auto
$this->logger->warning(
 'SES webhook payload, not processed due to unknown type.',
['Type' => $payload['Type'], 'payload' => json_encode($payload)]
);

```

change this to:

```auto
$this->logger->warning(
 'SES webhook payload, not processed due to unknown type.',
['Type' => '', 'payload' => json_encode($payload)]
);

```

After change this somewhere in your Mautic log files in

> var/log

must be the following content: SES webhook payload, not processed due to unknown type please copy over the content of the log arround that. Then hopefully we can see what is going wrong with the payload from SNS.

---

<div class="post-metadata">

**Author:** ![gregy1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gregy1/32/2029_2.png) [@gregy1](https://forum.mautic.org/u/gregy1)\
**Post date:** [May 17, 2024, 1:29pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/37 "2024-05-17T13:29:49Z")

</div>

hm…☹  
Now, I get no log entries …with or without the suggested changes in eventSubscriber/CallbackSubscriber.php - nothing in var/logs.

Despite of sending few bounce e-mails the only one that returned DNC is [bounce@simulator.amazonses.com](mailto:bounce@simulator.amazonses.com)  
 ![obraz](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/c4a49db2ea5995a45f267a61c2da85953af784fc.png)

I guess I have to give up 😥

---

<div class="post-metadata">

**Author:** ![aibanez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aibanez/32/3875_2.png) [@aibanez](https://forum.mautic.org/u/aibanez)\
**Post date:** [May 19, 2024, 9:13pm UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/38 "2024-05-19T21:13:09Z")

</div>

> [@e-tailors\_pm](#):
>
> AmazonSesBundle

Thank you for your plugin, I followed all your instructions but when I try to test email I receive the followin error: Unable to send an email: There are 1 partial failures, check logs for exception reasons .  
I checked the var/logs files and the directory is empty.

---

<div class="post-metadata">

**Author:** ![e-tailors\_pm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/e-tailors_pm/32/11642_2.png) [@e-tailors\_pm](https://forum.mautic.org/u/e-tailors_pm)\
**Post date:** [May 20, 2024, 8:49am UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/40 "2024-05-20T08:49:45Z")

</div>

Have u cleared the cache after installation ?  
Usually u may get an error notice of what is not correctly set on mail settings page.

---

<div class="post-metadata">

**Author:** ![e-tailors\_pm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/e-tailors_pm/32/11642_2.png) [@e-tailors\_pm](https://forum.mautic.org/u/e-tailors_pm)\
**Post date:** [May 20, 2024, 8:52am UTC](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334/41 "2024-05-20T08:52:36Z")

</div>

If everything is working properly when u mail to [bounce@simulator.amazonses.com](mailto:bounce@simulator.amazonses.com) i think the issue is maybe not on the module. Is the amazon account in production mode already ? If not maybe that is the reason why u gat an error.

What u also could try is setup SNS notification logs then u can see the payload which amazon sends.

U may also PB me with Amazon + mautic details, then i can do a quick view to see if i can see anything wrong.

[Previous page](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334.md?page=1)

[Next page](https://forum.mautic.org/t/mautic-5-0-3-aws-sns-endpoint-is-not-working-give-a-solution-to-handle-bounce-and-complaint-emails/31334.md?page=3)
