Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've been following this manual starting at page 26.

First I've already made a tunnel with stunnel, and also I've already got conected via command line with amazon servers, then in my postfix main.cf config file I've got this:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = mydomain.com ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = mydomain.com, localhost, localhost.localdomain
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
default_transport = error
relay_transport = error

relayhost = 127.0.0.1:2525
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = may
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

Then when I try to send mail, I've got this error from /var/log/mail.log:

Feb 29 22:23:03 ip-10-166-145-71 postfix/smtpd[29861]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 mymail@gmail.com: Recipient address rejected: 127.0.0.1:2525; from=welcome@mydomain.com to=mymail@gmail.com proto=ESMTP helo=ip-10-166-145-71.us-west-1.compute.internal

I've already granted permissions at the SES panel to welcome@mydomain.com. Also I don't understand why ehlo is "ip-10-166-145-71.us-west-1.compute.internal"... my /etc/mailname is already mydomain.com, also I've tried with exim4 and the result is the same.

I've already found similar questions but seems like I'm the only idiot stuck at this. Here's another tutorial I'm been following.

share|improve this question

2 Answers 2

<bot>Convert comment to CW</bot>

Detailed step by step was taken from this blog

  1. Download and extract script from this page.

  2. From the README file: These scripts get your AWS access key ID and secret access key from environment variables. The procedure for setting environment variables depends on your operating system. You need to do the following:

    • Create an environment variable called AWS_ACCESS_KEY_ID and set it to your AWS access key ID. Your AWS access key ID will look something like: AKIAIOSFODNN7EXAMPLE.

    • Create an environment variable called AWS_SECRET_ACCESS_KEY and set it to your AWS secret access key. Your AWS secret access key will look something like: wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY.

  3. Test the setup with sending message from perl script.

    $ echo 'test msg' > msgbody.txt
    $ ./ses-send-email.pl -s "Test of Amazon SES" -f user@example.com user@gmail.com < msgbody.txt
    
  4. Request SES Access by go to this page.

  5. Configure postfix. Modify the master.cf to add

    aws-email  unix  -       n       n       -       -       pipe
        flags=R user=support argv=/opt/thirdparty/amazon/bin/ses-send-email.pl -r -e https://email.us-east-1.amazonaws.com -f ${sender} ${recipient}
    

    Then Modify the main.cf to add

    default_transport = aws-email
    
  6. Copy SES.pm from extracted folder to /user/local/lib/site_perl (if not existing, create one), this is important!

Script notes:

Amazon SES no longer maintains these scripts. For command-line access to Amazon SES, you can use the AWS Command Line Interface or the AWS Tools for Windows PowerShell. To integrate your mail server with Amazon SES, you can use the Amazon SES Simple Mail Transfer Protocol (SMTP) interface. For more information, see Integrating Amazon SES with Your Existing Email Server.

share|improve this answer

Check the forward and reverse dns records for your host.

Karyn

share|improve this answer
    
thanks I've already found workaround at this blog. If I nslookup my IP, I get the default name that amazon uses, but thats not the same name I was getting in my logs. –  pacofvf Mar 1 '12 at 22:04

Your Answer

 
discard

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.