jkraemer/mail-gpg — pull request #12 by dmke (2014-03-11 14:45:14+00:00)
Title: Preserving Return-Path header

When a mail bounces (e.g. mailbox full, receiver unknown, etc.) it is sometimes desirable to undertake further actions.

Use cases include purchase confirmation mails, user activation mail (think: Rails + Devise) et cetera. In these cases you'd define a `"#{user.encrypted_and_obsuscated_id}@bounces.example.com"` catch-all mailbox processing incoming the bounce mails.

Without this patch, the Return-Path header is attached to the Mail::Part, not the envelope causing the MTA on the receiving end to ignore this field completely (i.e. no bounce mail is created).

(I've performed some additional cleanup and fixed the indentation in two cases)