Question

I am trying to send emails with my verified address (usertest@gmail.com), using an Ubuntu AWS Instance with postFix & Amazon SES but It is not working with postfix.

1) I've downloaded an "Amazon Simple Email Service Scripts" from this site

I followed the guide, and I can send emails using the following line:

./ses-send-email.pl --verbose -k aws-credentials -s "Test from SES" -f usertest@gmail.com usertest@gmail.com

so everything works good.

2) I've installed postfix, and I added the following line into /etc/postfix/master.cf in order to integrate the point 1

aws-email unix - n n - - pipe flags=R user=usertest argv=/opt/amazon-mail/ses-send-email.pl -r -k /opt/amazon-mail/aws-credentials -e https://email.us-east-1.amazonaws.com -f usertest@gmail.com ${recipient}

and then I added into /etc/postfix/main.cf

default_transport = aws-email

but when I try to send an email using:

echo test | mail -s "test email sent" usertest@gmail.com

I don't receive the email because postfix automatically remplaces the sender email address from usertest@gmail.com to root@gmail.com and root@gmail.com is not a verified email.

Also I've tried to set an alias in /etc/aliases but postfix doesn't replace root by usertest.

I only want to send some emails with my gmail email address in my PHP site allocated in a AWS Micro Instance. Its my first time in Amazon Cloud World, I think, I am doing something wrong here.

Could you help me?

Thanks in Advance.

Was it helpful?

Solution

I don't receive the email because postfix automatically remplaces the sender email address from usertest@gmail.com to root@gmail.com and root@gmail.com is not a verified email.

This is because you are sending from a Unix system account (signed in as root).

Also I've tried to set an alias in /etc/aliases but postfix doesn't replace root by usertest.

That's correct. You need a Mail Delivery Agent such as Dovecot with virtual users for Dovecot to authenticate them against Postfix, or you would have to create a Unix user account by that name and su to that user.

OTHER TIPS

Thanks I solved using sender_canonical_maps in main.cf postfix's file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top