postal icon indicating copy to clipboard operation
postal copied to clipboard

Extracting Bounced emails

Open wh4u opened this issue 5 years ago • 13 comments

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 ?

wh4u avatar May 29 '21 09:05 wh4u

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.

willpower232 avatar May 29 '21 16:05 willpower232

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]

wh4u avatar May 30 '21 08:05 wh4u

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.

willpower232 avatar Jun 01 '21 13:06 willpower232

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

SimonBiggs avatar Mar 29 '23 00:03 SimonBiggs

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

willpower232 avatar Mar 29 '23 13:03 willpower232

Yup, good point. I'll set up webhooks today. Thank you 😊

SimonBiggs avatar Mar 29 '23 20:03 SimonBiggs

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

image

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

SimonBiggs avatar Mar 30 '23 04:03 SimonBiggs

Hey Simon,

I had the exact same issue setting up webhook on Postal :

Screenshot from 2023-03-30 11-00-45

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

belghitioth avatar Mar 30 '23 09:03 belghitioth

@SimonBiggs @belghitioth this definitely sounds like an issue, are you able to open a bug report issue to focus their attention?

willpower232 avatar Mar 30 '23 15:03 willpower232

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.

SimonBiggs avatar Mar 30 '23 20:03 SimonBiggs

potentially an overlap with #2397

willpower232 avatar Apr 01 '23 09:04 willpower232

@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

belghitioth avatar Apr 03 '23 10:04 belghitioth

Thanks @belghitioth :slightly_smiling_face:

SimonBiggs avatar Apr 03 '23 10:04 SimonBiggs