Bounce messages not recognised #103

wakiki opened this Issue Sep 28, 2010 · 6 comments


None yet
4 participants

wakiki commented Sep 28, 2010

Many types of bounced messages are not being recognised.

Take this bounce for example from Google:

Is it possible to have more reliable bounce message handling?



mikel commented Sep 28, 2010

Sure it is possible.

But I work on mail in my spare time. So unless you are willing to either (a) supply a patch that solves the problem, or (b) sponsor me to fix it for you, you'll just have to wait until I have the same problem which motivates me enough to fix it.

If you want to donate, you can click the donate button on the mikel/mail github page and go for it. As you can see, not many people who have helped download the mail gem close to 400,000 times have contributed.

Mail is open source, I contributed it for free to the community. I spent probably close to 200+ development hours on it. I don't expect anything back monetarily for it, however, I do expect a bit more than "Hey buster, your bounce handling doesn't work, fix it. KTHXBAI"

Having said that, thanks for supplying the error email, I'll see what I can do when I work on mail next.


wakiki commented Sep 28, 2010

Hey Mikel,

Apologies if my ticket offended - that wasn't my intention.

The mail gem is brilliant, so much so that I'm now switching over completely to it.

I only just realised the problem with bounce handling recently, but it wasn't clear on the docs, so I thought I'd raise a ticket since I didn't know if you were even intending to fix it or if it was somehow the expected behaviour.

I'd love to help but I don't know enough about mail to do so...

I'd contribute something but I'm not a big company and don't want to offend further by the amounts that I'd contribute!



mikel commented Sep 28, 2010

Hi Steve,

That's cool. You don't have to contribute anything. I don't expect money.

This was the sentence that got on my nerves:

"Is it possible to have more reliable bounce message handling?"

But anyway.

Looking at the email you posted, the problem is that it is not a multipart-report email, and there is nothing in it that says it is a bounce email that is machine parse-able. The only thing there is an "X-Failed-Recipients" header. Which is a custom header and not guaranteed to stick around as it is not part of any spec.

I could set mail to search for that header, but not quite sure about that.

What would be better is for google to return an actual bounce email, which includes the bounced message as another part.

Anyway, that's why mail is not finding this email.

What you could do to help is see if there is any RFC or documentation that relates to how to parse this sort of non multipart report email...


wakiki commented Sep 28, 2010

Ah right. Apologies again.

It's going to be pretty impossible to get Google to change their bounce emails :)

In any case, bounces takes lots of forms and I only included one failing case.

It's annoying though because mail servers just seem to give whatever bounce errors they feel like.

I previously forked and contributed to this plugin:

As you can see it's somewhat haphazard but I'm not sure if it's possible to get it any better than that... I wished it was easier!

Perhaps we could port this code into Mail?


rngtng commented May 27, 2011

Hey I got my hands dirty on bounce-email as well:

Major change is to get it closer to Mail Gem: make use of it's bounce parsing and defer missing methods to the mail object.
So, if you wabt to catch more bounced mails just replace for

Check it out:

Cheers - Tobi


jeremy commented Jan 26, 2013

Merging in extensive, thorough bounce detection is quite an undertaking. Please do investigate, if you're interested! Using the bounce-email gem looks like a good alternative in the meantime.

jeremy closed this Jan 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment