Jump to:
| Project: | Return-Path |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Amazon SES cannot be used as a mail agent mail with drupal D6 as is, because D6 adds an Errors-To header which Amazon SES does not support:
https://forums.aws.amazon.com/thread.jspa?threadID=59211
http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail/6
A workaround can easily be implemented by modifying the returnpath module to remove the Errors-To header. In returnpath.module, replace the line
unset($message['headers']['From']);
with
unset($message['headers']['Errors-To']);
I noticed that if I remove the 'From' header then the the mail message appears to be sent from (www-data).
Drupal D7 works with Amazon SES out of the box. It does not add the Errors-To header and does not need a From address fix.
Comments
#1
Why not keep the
unset($message['headers']['From']);
line and just add the
unset($message['headers']['Errors-To']);
line? That way, the email should still appear to be coming from whatever you've set the drupal admin address to, right? Otherwise, if you have mutliple drupal sites, all the emails would look to be coming from the same domain/address.
#2
For the issue at hand, unestting 'Errors-To' is enough.
The return_path module adds a 'Return-Path' header, but I noticed that in my particular setup I got better results if I don't do any changes to the 'From' header. Otherwise I was seeing 'www-data' as the sender address.
So, in my version of the module I did what I described above and now it works as expected.