Extracting Bounced emails
A big newsletter list came up with 21.2% bounce rate. is there a way to extract the bounced emails so that we can remove them from our list? If this feature isn't supported in any way (either via browser or ssh) our newsletter software can connect to our bounce mailbox, "read" bounce messages, determine which e-mail address bounced and automatically execute actions e.g unsubscribe.
Our bounce messages will be automatically sent to the address we specified as “bounce address”.
How do you suggest we handle this with postal smtp ?
Postal is not designed to act as your mailing list manager so your newsletter software would have to integrate with Postals webhooks to understand what happened to each message.
Have you already been able to receive bounces when sending messages via Postal? I thought they would be sent to the PSRP address which has no mailbox and is only processed by Postal.
No i am not receiving the bounces in my bounce mailbox via postal i can only see them in postal interface. They are delivered to [email protected]
That makes sense, so you would have to integrate with the webhooks in order to handle bounces as they happen. I don't think you'll be able to extract the previous bounces without messing around in the database.
Unfortunately it doesn't seem like GitHub issues and GitHub discussions automatically receive back links, so I am posting a link here that I have enquired further on this closed issue given some recent API developments:
https://github.com/postalserver/postal/discussions/2362#discussioncomment-5459877
even if you could receive this information over the API, it will not be stored long term by default so does not make sense as an API endpoint because it will eventually just return nothing even though messages were bounced.
relying on webhooks makes much more sense from a data standpoint as you're learning about the issue as it occurs and not being confused about trying to find out about it later at a random point in time
Yup, good point. I'll set up webhooks today. Thank you 😊
Ahh, unfortunately it looks like I can't use webhooks.
After applying this patch to the stable release:
https://github.com/postalserver/postal/commit/c42dd1b9f6c55a75dcaea74a725e5f8703729ec7
In order to fix this issue:
https://github.com/postalserver/postal/issues/98#issuecomment-1486144615
When I set up a web hook I get the following error:
Psych::DisallowedClass: Tried to load unspecified class: Symbol

Which appears to be due to a security update in Rails:
https://stackoverflow.com/questions/72970170/upgrading-to-rails-6-1-6-1-causes-psychdisallowedclass-tried-to-load-unspecif
I suspect I won't be able to use webhooks until there's a new stable release created.
Thank you though.
Cheers, Simon
Hey Simon,
I had the exact same issue setting up webhook on Postal :

I checked the logs of postal-worker container and it seems to be related to the line 41 on app/models/webhook_request.rb when the payload is being serialized by Hash:
server.webhook_requests.create!(:event => event, :payload => payload, :webhook => webhook, :url => webhook.url)
I found the same fix : https://stackoverflow.com/questions/72970170/upgrading-to-rails-6-1-6-1-causes-psychdisallowedclass-tried-to-load-unspecif
It is really blocking for us as we need to be notified for each action done on Postal
Is this fix scheduled already ?
Thanks for your help,
Othmane
@SimonBiggs @belghitioth this definitely sounds like an issue, are you able to open a bug report issue to focus their attention?
Yup certainly. @belghitioth, did you want to write that up?
I suspect the first step is to actually forge a release from what is currently on main.
potentially an overlap with #2397
@SimonBiggs I created the issue right here : https://github.com/postalserver/postal/issues/2398
I think in the meantime we could use the version before the latest release which is 2.1.2
Thanks @belghitioth :slightly_smiling_face: