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

meecect’s picture

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.

alex.a’s picture

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.

avpaderno’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, as it has been created for a version that isn't supported anymore and the project doesn't have versions for any supported Drupal version (actually Drupal 7, Drupal 8, and Drupal 9).