I'm in the process of setting up a server in the cloud (Amazon EC2) and, because the address space of these cloud servers blocked by most spam filters, I need for all outgoing mail to be sent by some other machine. Also, for various reasons such as limited disk space and the fact that no one will ever check email on this machine, I would like to make sure that mail is never delivered to any local mailboxes on this machine. I.e., all mail for root or root@localhost or root@whatever will be sent instead to
root@mydomain.com.
I have tried a variety of settings using postfix and trying to route everything through Amazon SES using a perl script they provide but
have encountered problems. In particular, these two problems:
* every sender (process/person/whatever) that wants to send mail via perl script must have their email address "verified" by the Amazon SES system. This requires me to receive a registration email and click a link
for each and every different sending email on my server. this hassle is a show-stopper
* bounce notifications (which I have managed to steer to an external domain rather than being delivered locally) fail to be delivered by Amazon SES due to an "illegal content type" error:
Code:
Oct 13 16:56:50 domU-12-31-39-02-82-53 postfix/pipe[7712]: 080BC20396: to=<root@example.com>, relay=aws-email, delay=0.62, delays=0.06/0/0/0.56, dsn=5.3.0, status=bounced (Command died with status 1: "/usr/src/bin/ses-send-email.pl". Command output: Illegal content type 'message/delivery-status'. <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/"> <Error> <Type>Sender</Type> <Code>InvalidParameterValue</Code> <Message>Illegal content type 'message/delivery-status'.</Message> </Error> <RequestId>f31709af-1944-11e2-afd8-4306477b7a3c</RequestId> </ErrorResponse> )
I believe that one can set up an SMTP access point through Amazon SES and am considering that approach, but I'm not really sure how to set up my server such that ALL mail will go through this SMTP server -- meaning emails intended for root, emails sent from PHP scripts, emails sent by any user or process. I think that such a configuration might be possible using postfix, but the documentation is sprawling and I haven't managed to figure out where the access credentials -- one user/pass for the entire server -- might go. Someone suggested a null client like msmtp or esmtp, but I'm not sure I can eliminate local mail delivery with those or not.
Has anyone done something like this before? I'd very much appreciate some help figuring this out. I've been tweaking postfix and
trying stuff but still haven't sorted this.