Ubuntu

在 Ubuntu (natty narwhal) Amazon Ec2 實例上為 php mail() 配置後綴

  • August 30, 2011

我是第一次設置 sendmail 和 postfix。我相信它已正確安裝,但我需要有關配置的幫助。當我呼叫 mail() 時,我在 /var/log/mail.log 中得到以下資訊

Aug 30 06:13:52 ip-10-202-193-59 postfix/pickup[28117]: 866186010F: uid=33 from=<www-data>
Aug 30 06:13:52 ip-10-202-193-59 postfix/cleanup[28125]: 866186010F: message-id=<20110830061352.866186010F@ip-10-202-193-59.ec2.internal> 
Aug 30 06:13:52 ip-10-202-193-59 postfix/qmgr[28118]: 866186010F: from=<www-data@bellcreativestudio.com>, size=392, nrcpt=1 (queue active)
Aug 30 06:13:52 ip-10-202-193-59 postfix/smtp[28127]: 866186010F: to=<ryanbell@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.113.27]:25, delay=0.$
Aug 30 06:13:52 ip-10-202-193-59 postfix/qmgr[28118]: 866186010F: removed

消息永遠不會傳遞。

我的後綴配置如下:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = bellcreativestudio.com, ip-10-202-193-59.ec2.internal, localhost.ec2.internal, localhost
myhostname = bellcreativestudio.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = 
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

後綴事務日誌看起來不錯。您可能會檢查 gmail 上的“垃圾郵件”文件夾,以防它被錯誤分類(可能是由於您的配置)並在那裡結束。

引用自:https://serverfault.com/questions/306318