I am using the webform module and mandrill module together.
Emails were being bounced by certain recipients with the error:
"smtp;550 Messages should have one or no Reply-To headers, not 2."
The issue was the webmail module was setting a reply-to attribute in the header array using the array key "Reply-to". Mandrill's module is checking for an array key "Reply-To" (Capital T in "To"). If mandrill does not find that key, it adds an array item with the key "Reply-To". This results in two array items: $header['Reply-to'] and $header['Reply-To'] and as a result two Reply-To headers in the email.
I confirmed the email specifications declare the headers case insensitive.
https://stackoverflow.com/a/6143644
Therefore this issue is drupal specific and about the interplay of different contributed modules extending one another.
I searched core and found a mix of uses of "Reply-to", "Reply-To" and "reply-to". Googling around "Reply-to:" seems most popular.
A simple fix could be to confirm to webmail's module and use the key 'Reply-to'. I will provide a patch below.
However, I may suggest a more robust solution that can handle any mixed capitalization. I will provide that patch below also.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | mandrill-reply-to-capitalization-2881210-5-D8.patch | 1.22 KB | criz |
| #2 | mandrill-reply-to-capitaization-2881210-1-D8.patch | 1.21 KB | maestrojed |
Comments
Comment #2
maestrojed commentedThe provide patch attempts to allow for any mix of capitalization in the header key "Reply-to". Different contributed modules may not be consistent in their capitalization.
This is achieved by making a mapping between all header keys and their lowercase version.
When this mandrill module adds a "Reply-to" header it will use the more popular "Reply-to" opposed to the previously "Reply-To".
Comment #3
maestrojed commentedComment #4
nikathone+1 for RTBC. Can confirm that the patch above is fixing the issue. Was having two reply to headers before applying the patch.
Comment #5
crizThis patch works for us. We had some bounces because of this issue.
Just fixed some typos and coding standard.
Comment #6
Ante890 commentedTime to merge?
Comment #7
samuel.mortensonComment #8
knyshuk.vova commentedThe patch looks good and applies successfully. +1 for RTBC.
Comment #9
rjacobsen0 commentedThis is great! The only change I might make is to make the first letter capital in the final header array, that is, Reply-to instead of reply-to. But this is a minor point.
Comment #11
rjacobsen0 commented