从第26页开始,我一直在关注本手册 。
首先,我已经用stunnel做了一个隧道,而且我已经通过命令行与amazon服务器进行了连接,然后在我的postfix main.cfconfiguration文件中,我已经得到了这个:
# 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
然后当我尝试发送邮件时,我从/var/log/mail.log中得到这个错误:
2月29日22:23:03 ip-10-166-145-71 postfix / smtpd [29861]:NOQUEUE:拒绝:来自本地主机的RCPT [127.0.0.1]:550 5.1.1 [email protected]:收件人地址被拒绝: 127.0.0.1:2525; from = [email protected] [email protected] proto = ESMTP helo = ip-10-166-145-71.us-west-1.compute.internal
我已经在SES面板上将权限授予[email protected]。 我也不明白为什么ehlo是“ip-10-166-145-71.us-west-1.compute.internal”…我的/ etc / mailname已经是mydomain.com,我也试过exim4和结果是一样的。
我已经发现了类似的问题,但似乎我是唯一的白痴卡住了。 这是我一直在关注的另一个教程 。
详细的一步一步来自这个博客。
从此页面下载并提取脚本。
从自述文件:这些脚本从环境variables中获取您的AWS访问密钥ID和秘密访问密钥。 设置环境variables的过程取决于您的操作系统。 您需要执行以下操作:
创build一个名为AWS_ACCESS_KEY_ID的环境variables,并将其设置为您的AWS访问密钥ID。 您的AWS访问密钥ID将如下所示: AKIAIOSFODNN7EXAMPLE 。
创build一个名为AWS_SECRET_ACCESS_KEY的环境variables,并将其设置为您的AWS秘密访问密钥。 您的AWS秘密访问密钥将如下所示: wJalrXUtnFEMI / K7MDENG / bPxRfiCYzEXAMPLEKEY 。
从perl脚本发送消息来testing设置。
$ echo 'test msg' > msgbody.txt $ ./ses-send-email.pl -s "Test of Amazon SES" -f [email protected] [email protected] < msgbody.txt
申请SES访问转到此页面 。
configuration后缀。 修改master.cf来添加
aws-email unix - nn - - 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}
然后修改main.cf来添加
default_transport = aws-email
从提取的文件夹复制SES.pm到/user/local/lib/site_perl (如果不存在,创build一个),这很重要!
脚本说明:
Amazon SES不再维护这些脚本。 对于Amazon SES的命令行访问,您可以使用AWS Command Line Interface或AWS Tools for Windows PowerShell。 要将邮件服务器与Amazon SES集成,您可以使用Amazon SES简单邮件传输协议(SMTP)界面。 有关更多信息,请参阅将Amazon SES与现有电子邮件服务器集成。
检查主机的正向和反向dnslogging。
卡林