Resource icon

Amazon SES Bounces Support 2021-03-19

No permission to download
Getting lots of these too since installing and setting this up

  • ErrorException: [E_WARNING] Attempt to read property "recipient" on bool
  • src/XF/EmailBounce/Processor.php:106
  • Generated by: Unknown account
  • Apr 23, 2023 at 6:36 PM

Stack trace​

#0 src/XF/EmailBounce/Processor.php(106): XF::handlePhpError(2, '[E_WARNING] Att...', '/home/nginx/dom...', 106)
#1 src/addons/Laneros/MailTransport/Api/Controller/SnsNotification.php(45): XF\EmailBounce\Processor->processMessage('{"notificationT...')
#2 src/XF/Mvc/Dispatcher.php(352): Laneros\MailTransport\Api\Controller\SnsNotification->actionPost(Object(XF\Mvc\ParameterBag))
#3 src/XF/Api/Mvc/Dispatcher.php(27): XF\Mvc\Dispatcher->dispatchClass('Laneros\\MailTra...', 'Post', Object(XF\Api\Mvc\RouteMatch), Object(Laneros\MailTransport\Api\Controller\SnsNotification), NULL)
#4 src/XF/Mvc/Dispatcher.php(115): XF\Api\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Api\Mvc\RouteMatch), Object(Laneros\MailTransport\Api\Controller\SnsNotification), NULL)
#5 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Api\Mvc\RouteMatch))
#6 src/XF/App.php(2483): XF\Mvc\Dispatcher->run()
#7 src/XF.php(524): XF\App->run()
#8 index.php(16): XF::runApp('XF\\Api\\App')
#9 {main}

Request state​

array(4) {
["url"] => string(22) "/api/amazon-ses/bounce"
["referrer"] => bool(false)
["_GET"] => array(1) {
["/api/amazon-ses/bounce"] => string(0) ""
}
["_POST"] => array(0) {
}
}

I think that this error appears, if you put the wrong URL in the Amazon SNS subscription field while creating a subscription. Probably you have a typo in the URL or you forget to add "community" or "forum" in the URL.

Do you still have this problem?
 
Last edited:
Hi Julian, thanks for a great addon. I am looking to get this enabled on our forums, as we use SES to process emails. Quick q:

In the SNS topic for our forum, under subscriptions I see that the Endpoint for our HTTPS protocol is showing as pending confirmation. I can request confirmation, but have zero clue where this is going to. Any idea?

I am new to this too and still experiment, but it seems that you have first to install the addon in XF and only after that you do the settings in Amazon SNS.

If then this error still appears, you very likely have a typo in your endpoint URL or you forgot to add your directory in which XF is installed, i.e. "community" or "forum". The correct URL needs to be then

Code:
https://www.yourdomainname.com/community/api/amazon-ses/bounce

Do you still have this problem?
 
Last edited:
There's nothing that needs to be changed, this add-on works fine.

People seem to be getting confused with how it works though.
No, it doesn't "work fine" for everyone....
I was getting the same error as
and it was consistent... ergo the reason I disabled it.
 
See my posting #81 above
considering I did a cut/paste from the instructions for the endpoint (and changed the domain), don't think that was it.
there was something else that was going on. And my site is based in the root location, so no community or similar use.
 
considering I did a cut/paste from the instructions for the endpoint (and changed the domain), don't think that was it.
there was something else that was going on. And my site is based in the root location, so no community or similar use.
That error is because this is missing from the instructions

 
considering I did a cut/paste from the instructions for the endpoint (and changed the domain), don't think that was it.
there was something else that was going on.

Just try it out. I had the same error and this fixed it. Delete the old topic & subscriptions. Uninstall the addon.

Then reinstall the addon and create new topic and new subscription.

Use the exact same path to your XF installation (copy it from your browser).

This error appears while Amazon SNS checks and tries to confirm the path to this addon. If the path to the addon is wrong, there is no way for the addon to talk to Amazon SNS. No communication -> no confirmation.
 
Last edited:
That error is because this is missing from the instructions


I do not get the error anymore after I did the above steps. No matter with or without "Enable raw message delivery" checked.
 
Just try it out. I had the same error and this fixed it. Delete the old topic & subscriptions. Uninstall the addon.

Then reinstall the addon and create new topic and new subscription.

Use the exact same path to your XF installation (copy it from your browser).

This error appears while Amazon SNS checks and tries to confirm the path to this addon. If the path to the addon is wrong, there is no way for the addon to talk to Amazon SNS. No communication -> no confirmation.
Already have when I first installed the add-on... and the endpoint was confirmed...

Screen Shot 2023-06-19 at 4.20.48 PM.png

In fact, repeated the same test that I did this morning before re-enabling this add-on.... guess what has NOT occurred... the user is still in valid state and should be in a bounced state.
I've currently totally removed my old bounce email and login information to test to see if this is working.

And here is what we get:
Code:
ErrorException: [E_WARNING] Attempt to read property "recipient" on bool
src/XF/EmailBounce/Processor.php:106
Generated by: Unknown account
June 19, 2023 at 4:27 PM

Stack trace
#0 src/XF/EmailBounce/Processor.php(106): XF::handlePhpError(2, '[E_WARNING] Att...', '/home/nginx/dom...', 106)
#1 src/addons/Laneros/MailTransport/Api/Controller/SnsNotification.php(45): XF\EmailBounce\Processor->processMessage('{"notificationT...')
#2 src/XF/Mvc/Dispatcher.php(352): Laneros\MailTransport\Api\Controller\SnsNotification->actionPost(Object(XF\Mvc\ParameterBag))
#3 src/XF/Api/Mvc/Dispatcher.php(27): XF\Mvc\Dispatcher->dispatchClass('Laneros\\MailTra...', 'Post', Object(XF\Api\Mvc\RouteMatch), Object(Laneros\MailTransport\Api\Controller\SnsNotification), NULL)
#4 src/XF/Mvc/Dispatcher.php(115): XF\Api\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Api\Mvc\RouteMatch), Object(Laneros\MailTransport\Api\Controller\SnsNotification), NULL)
#5 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Api\Mvc\RouteMatch))
#6 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#7 src/XF.php(524): XF\App->run()
#8 index.php(16): XF::runApp('XF\\Api\\App')
#9 {main}
Request state
array(4) {
  ["url"] => string(22) "/api/amazon-ses/bounce"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/api/amazon-ses/bounce"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

Screen Shot 2023-06-19 at 4.38.48 PM.png

Guess I can delete them all and create them again and see if it changes, but I'm pretty sure it's "working" as far as the API endpoint goes as this is what returns when you visit that destination.

Screen Shot 2023-06-19 at 4.41.44 PM.png

EDIT:
Created all new.... and the subscription is in confirmed state (done twice) and now no errors...but also the test user with the bad email is still in a valid state, but I did get a "soft bounce" warning.... it really should have been a hard bounce.

EDIT 2:

OK... got it to working...but what I had to do was actually use my site sending email identity of no_reply@mydomain.com and set up the feedback notifications for it. For some reason, it would not work when doing it for the domain identity.

I still think there is an issue.... as this test email should be a HARD bounce... not a soft bounce as the address simply does not exist.
And when I had an actual bounced email address set up, it would show as a hard bounce.
 
Last edited:
EDIT 2:

OK... got it to working...but what I had to do was actually use my site sending email identity of no_reply@mydomain.com and set up the feedback notifications for it. For some reason, it would not work when doing it for the domain identity.

I still think there is an issue.... as this test email should be a HARD bounce... not a soft bounce as the address simply does not exist.
And when I had an actual bounced email address set up, it would show as a hard bounce.

Great!

Then I will now try the same settings in Amazon SES too and report back. We just need to be stubbern, combine our efforts and we will find a solution!

Edit 1: I added in Amazon SES/verified identities my sending email address with email forward enabled and with email notification via SNS and selecting the topic I created earlier with Amazon SNS. First reaction was, that I got some errors from all my attempts of yesterday. Same XF error code as you have shown above. Also suddenly there are entries in the bounce log of XF of my attempts of yesterday.

BUT I do not get new bounces. Only the old ones for the time beeing. It seems that Amazon is trying to deliver first for 840 minutes and only after that it sends the bounce notification. See the screenshot below of the XF bounce log. Slowly more bounces drop in every few minutes. But always from yesterday.

XF_bounce_log_attempts_of_yesterday1.jpg

At the moment I have checked "Enable raw message delivery" in Amazon SNS for my subscription.
 
Last edited:
what I had to do was actually use my site sending email identity of no_reply@mydomain.com and set up the feedback notifications for it. For some reason, it would not work when doing it for the domain identity.

Did you disable the SNS notification for the domain or did you leave it enabled?

Did you enable the SNS notification ("Feedback notifications") with the SNS topic subscription for your sending email or did you only enable the normal email forwarding ("Email feedback forwarding") and nothing additional in the lower SNS part ("Feedback notifications")?
 
Did you disable the SNS notification for the domain or did you leave it enabled?
Left it enabled.
Did you enable the SNS notification ("Feedback notifications") with the SNS topic subscription for your sending email or did you only enable the normal email forwarding ("Email feedback forwarding") and nothing additional in the lower SNS part ("Feedback notifications")?

Screen Shot 2023-06-20 at 7.16.00 AM.webp

Screen Shot 2023-06-20 at 7.14.39 AM.webp
 
It is really strange. I think I do have now the exact same settings as @Tracy Perry , but I do not get bounce notifications immediately. All bounces I do see in the XF/ACP bounce log are old. All sent to me after 840 minutes = after 14 hours. See screenshot in my posting above.

Has anybody an idea what I can change to get the bounces faster?

Could the AWS region be responsible for this different behavior?
 
It is really strange. I think I do have now the exact same settings as @Tracy Perry , but I do not get bounce notifications immediately. All bounces I do see in the XF/ACP bounce log are old. All sent to me after 840 minutes = after 14 hours. See screenshot in my posting above.

Has anybody an idea what I can change to get the bounces faster?

Could the AWS region be responsible for this different behavior?
Are they definitely SNS messages and not things going into the inbox?

You can click to view the details of the bounce to check.
 
See my screenshot in my posting #92
Sorry I couldn't see that on mobile.

Ok, so this means everything is working. SES is retrying the message for 840 minutes and then bouncing it back after that.

This is part of their spec : https://aws.amazon.com/blogs/messag...l-could-get-delayed-when-sending-through-ses/

Only a hard bounce will return instantly.

I wonder if perhaps everything has been working correctly all along, you just didn't give it enough time to return any failures!
 
no, the user status does not change at all in XF/ACP



This is a hard bounce. That domain name I used for the test email address does not exist. So the notification should come instantly and change the user status. Both does not happen.
But ses doesn't see it as a hard bounce, as in that log. Amazon sees it as a transient error, dns lookup failure. This could also be caused by a DNS server that is down, so you wouldn't want to hard that just in case.

A soft bounce won't change user status until it happens 3 times.

If it's in the xf bounce log, it means it's working.

If you want to test a hard bounce, send it to a Gmail account that doesn't exist. That will return instantly.
 
Last edited:
Top Bottom