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

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.

1 Like

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

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.

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

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.


Hope this helps u!

Thank you.

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?

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

1 Like

Thank you for your response @joeyk.

I belive it is installed in the correct folder:

/home/manehu/web/mautic.ctrlt.es/public_html/plugins#

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

Hi Gregy1,

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

Please let me know!

Regards Paul

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

To confirm sns suscription check readme of plugin

Regards!

2 Likes

Hello!

Thank you very much for your reply!

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

The Bundle is installed in the plugins folder.

Mautic shows the plugin as active:

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

SNS Endpoint is also confirmed:

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

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?

:sob:

P.S. My instance is on shared hosting.

You may need to try 2465 port instead of 465.

obraz

It worked with me.

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

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

:frowning:

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

eventSubscriber/CallbackSubscriber.php

somewhere arround

line2 34

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

change this to:

$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.

hm…:frowning:
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
obraz

I guess I have to give up :disappointed_relieved:

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.

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

If everything is working properly when u mail to 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.