Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running postfix using Amazon SES as the mail transport. Mail is sent out fine, however when I receive mail and try to forward it using a virtual alias, I get this error in the mailog:

 (Command died with status 1: "/ses/". Command output: Illegal header 'Delivered-To'. )

I see that SES does not support the 'Delivered-To' header so how can I forward email? I have softbounce ON if that means anything, maybe turning it off will work?

share|improve this question

You could specify prepend_delivered_header = file to disable inserting 'Delivered-To' header when forwarding. See documentation for details.

share|improve this answer

I know this question is a year old but why use the script when Postfix handles relaying through SES just fine using SMTP.

You can either setup your relayhost if the only email being sent is from a verified sender or verified domain or you can use sender_dependent_relayhost_maps to relay only those domains and senders verified.

In either case you would start by setting up the SASL password for SMTP AUTH. I use /etc/postfix/sasl_password and it should follow the format of:    SES-USER:SES-USER-PASSWORD

Update to use the SMTP host from your AWS SES Console and the appropriate SES SMTP user credentials. Next you need to configure the SMTP SASL client settings in /etc/postfix/ by adding the following:

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
smtp_sasl_mechanism_filter = login

Now run postmap /etc/postfix/sasl_password and that is all set. Now you have to decide if you're relaying everything or just verified senders/domains. If relaying everything then simply add the following to your

relayhost =

On the other hand if you only want to send verified senders/domains then add the following to your instead:

sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps

Then in /etc/postfix/relayhost_maps add your verified senders/domains following the format of:  

Run that file through postmap /etc/postfix/relayhost_maps and do a postfix reload and you should be sending emails through SES.

share|improve this answer
They started supporting SMTP for SES only in December 2011. – AlexD Apr 20 '13 at 18:44

You can edit to convert illegal headers to X- headers.

Check here for sample code:

share|improve this answer

I use header_checks and REPLACE action in postfix like so:

/^(Delivered-To:.*)$/ REPLACE X-$1

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.