我在一个专用服务器OVH(nsxxxxxxx.ovh.net)上工作,该服务器托管了几个不同的站点(用PHP制作)。目前没有发送电子邮件,这是非常有问题的..我已经尝试配置所有内容,但到目前为止没有任何作用。
我有一个使用EuroDNS(nomdedomaine.fr)的域名,以及Google的电子邮件地址(gmail业务,允许使用name@nomdedomaine.fr)。
我想要的是什么:只是从设置的网站,您可以发送电子邮件,但不能通过相同的送货地址。例如:我不希望在site1.com上收到来自contact@nomdedomaine.Fr的电子邮件,而不是contact@site1.com。
EuroDNS on,这是DNS文件:
; zone file for nomdedomaine.fr
$ORIGIN nomdedomaine.fr.
$TTL 3600
@ 86400 IN SOA ns1.eurodns.com. hostmaster.eurodns.com. (
2016050300 ; serial
86400 ; refresh
7200 ; retry
604800 ; expire
86400 ; minimum
)
@ 86400 IN NS ns1.eurodns.com.
@ 86400 IN NS ns2.eurodns.com.
@ 86400 IN NS ns3.eurodns.com.
@ 86400 IN NS ns4.eurodns.com.
; Mail Exchanger definition
@ IN MX 10 aspmx.l.google.com.
@ IN MX 20 alt1.aspmx.l.google.com.
@ IN MX 20 alt2.aspmx.l.google.com.
@ IN MX 30 aspmx2.googlemail.com.
@ IN MX 30 aspmx3.googlemail.com.
; IPv4 Address definition
@ IN A xxx.xxx.xx.xx
sousdomaine2 IN A xxx.xxx.xx.xx
sousdomaine1 IN A xxx.xxx.xx.xx
smtp IN A xxx.xxx.xx.xx
www IN A xxx.xxx.xx.xx
; Canonical Name definition
xxxxxxxxx IN CNAME gv-xxxxxxxxxx.dv.googlehosted.com.
; Sender Policy Framework definition
@ IN SPF "v=spf1 include:_spf.google.com ~all"
在OVH管理器上,配置了反向IP:
xxx.xxx.xx.xx - nsxxxxxxx.ovh.net.
在OVH服务器上: 我安装了Postfix,用sendmail配置php.ini:
sendmail_path = "/usr/sbin/sendmail -t -i"
/ etc / hostname包含:
nsxxxxxxx.ovh
/ etc / mailname包含:
nsxxxxxxx.ovh.net
/ etc / hosts包含在文件的开头:
127.0.0.1 localhost.localdomain localhost
xxx.xxx.xx.xx nsxxxxxxx.ovh.net nsxxxxxxx.ovh
xxxx:xxxx:x:xxxx:: nsxxxxxxx.ovh.net nsxxxxxxx.ovh
/etc/postfix/main.cf的后缀配置:
# 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 = $myhostname ESMTP $mail_name (Debian/GNU)
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.
#smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = nsxxxxxxx.ovh.net<br>alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = nsxxxxxxx.ovh.net, localhost.ovh.net, localhost<br>relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
最后,当我尝试通过以下方式发送电子邮件时:
echo "salut quelle note pour cet envoi de mail ?" | mail -s "tester mon envoi de mail" web-XtgXPY@yopmail.com
(YopMail可以接收垃圾邮件,这些都是虚假地址)。
显然我还没有收到任何东西,并在mail.log文件中得到了相应的结果:
May 3 14:00:40 nsxxxxxxx postfix/pickup[19451]: 3CF87CC1F1: uid=0 from=<root>
May 3 14:00:40 nsxxxxxxx postfix/cleanup[24287]: 3CF87CC1F1: message-id=<20160503120040.3CF87CC1F1@nsxxxxxxx.ovh.net>
May 3 14:00:40 nsxxxxxxx postfix/qmgr[12155]: 3CF87CC1F1: from=<root@#nomdedomaine.fr>, size=368, nrcpt=1 (queue active)
May 3 14:00:40 nsxxxxxxx postfix/smtp[24289]: 3CF87CC1F1: to=<web-XtgXPY@yopmail.com>, relay=smtp.yopmail.com[87.98.164.155]:25, delay=0.19, delays=0.05/0/0.1/0.03, dsn=5.0.0, status=bounced (host smtp.yopmail.com[87.98.164.155] said: 550 Unrouteable sender address (in reply to RCPT TO command))
May 3 14:00:40 nsxxxxxxx postfix/cleanup[24287]: 641A3CC1F2: message-id=<20160503120040.641A3CC1F2@nsxxxxxxx.ovh.net>
May 3 14:00:40 nsxxxxxxx postfix/bounce[24290]: 3CF87CC1F1: sender non-delivery notification: 641A3CC1F2
May 3 14:00:40 nsxxxxxxx postfix/qmgr[12155]: 641A3CC1F2: from=<>, size=2260, nrcpt=1 (queue active)
May 3 14:00:40 nsxxxxxxx 018962 postfix/qmgr[12155]: 3CF87CC1F1: removed
May 3 14:00:40 nsxxxxxxx postfix/error[24291]: 641A3CC1F2: to=<root@#nomdedomaine.fr>, relay=none, delay=0.07, delays=0.03/0.02/0/0.03, dsn=5.1.3, status=bounced (bad address syntax)
May 3 14:00:40 nsxxxxxxx postfix/qmgr[12155]: 641A3CC1F2: removed
我发现自己有点卡住了......我怀疑配置不正确,但这对我来说太晦涩难懂了......需要一个慈善的灵魂:)