Webhooks for automatic bounce email handling

pmoi

New member
Chris D suggested I make a separate thread into suggestion forum about using webhooks instead of emails to process the cases when outgoing mail has bounced and we want to record those bounces.

I am using zeptomail as my email provider as I found their pricing to be much more attractive than for example postmarkapp
zeptomail does not send emails at all for bounces as far as I understand and webhooks is their only supported method of getting the bounce information.
I am currently processing the webhook with https://webhook.site service as that was something I could cook up in matter of hours into working so that this service sends email to xenforo as an email that XenForo then can process in the automatic email handler. This setup is currently working with no apparent problem.

However I would be very interested to if xenforo could process the webhook natively and I believe that could be a very useful configuration for many others as well and in the future I could imagine many other email providers also could start offering webhooks as that is a robust and professional solution to a problem that is currently served with the emails as a very nonsatisfactory solution all around and especially if the emails need to be parsed with a computer that is just a huge hack that requires a lot of manpower collectively to wonder what is wrong and whether it is working. Webhooks could be a solution that works reliably and professionally with much less manpower to wonder about hacky issues.

Their example data structure that zeptomail sends in the webhook is:
{
"event_name": [
"hardbounce"
],
"event_message": [
{
"email_info": {
"email_reference": "13ef.29be9bd5dc4d0f0b.m1.b45dcac0-ebac-11eb-8ab6-525400b65433.17ad337516c@zillium.com",
"is_smtp_trigger": false,
"subject": "webhook test email",
"bounce_address": "webhooktest@zillium.com",
"from": {
"address": "webhooktest@zillium.com",
"name": "webhooktest"
},
"to": [
{
"email_address": {
"address": "bouncerecipient@zillium.com"
}
},
{
"email_address": {
"address": "testrecipient@zillium.com"
}
}
],
"tag": "unknown",
"processed_time": "2021-07-23T11:54:15Z",
"object": "email"
},
"event_data": [
{
"details": [
{
"reason": "relaying-issues",
"bounced_recipient": "bouncerecipient@zillium.com",
"time": "2021-07-23T11:54:15Z",
"diagnostic_message": "bad-mailbox"
}
],
"object": "hardbounce"
}
],
"request_id": "13ef.29be9bd5dc4d0f0b.m1.b45dcac0-ebac-11eb-8ab6-525400b65433.17ad337516c"
}
],
"mailagent_key": "13ef.29be9bd5dc4d0f0b.683ef94c9f44433f",
"webhook_request_id": "13ef.29be9bd5dc4d0f0b.w1.b45df1d1-ebac-11eb-8ab6-525400b65433.17ad337516d"
}

------------------

{
"event_name": [
"softbounce"
],
"event_message": [
{
"email_info": {
"email_reference": "13ef.29be9bd5dc4d0f0b.m1.457ee4c0-eba4-11eb-8ab6-525400b65433.17ad3000d0c@zillium.com",
"is_smtp_trigger": false,
"subject": "webhook test email",
"bounce_address": "webhooktest@zillium.com",
"from": {
"address": "webhooktest@zillium.com",
"name": "webhooktest"
},
"to": [
{
"email_address": {
"address": "bouncerecipient@zillium.com"
}
},
{
"email_address": {
"address": "testrecipient@zillium.com"
}
}
],
"tag": "unknown",
"processed_time": "2021-07-23T10:53:53Z",
"object": "email"
},
"event_data": [
{
"details": [
{
"reason": "relaying-issues",
"bounced_recipient": "bouncerecipient@zillium.com",
"time": "2021-07-23T10:53:53Z",
"diagnostic_message": "policy-related"
}
],
"object": "softbounce"
}
],
"request_id": "13ef.29be9bd5dc4d0f0b.m1.457ee4c0-eba4-11eb-8ab6-525400b65433.17ad3000d0c"
}
],
"mailagent_key": "13ef.29be9bd5dc4d0f0b.683ef94c9f44433f",
"webhook_request_id": "13ef.29be9bd5dc4d0f0b.w1.457f32e0-eba4-11eb-8ab6-525400b65433.17ad3000d0e"
}
 
Upvote 1
Top