Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
配置postfix/php发送邮件_Php_Email_Postfix Mta - Fatal编程技术网

配置postfix/php发送邮件

配置postfix/php发送邮件,php,email,postfix-mta,Php,Email,Postfix Mta,我在一个专用的服务器OVH(nsxxxxxxx.OVH.net)上工作,该服务器承载几个不同的站点(用PHP制作)。目前没有发送电子邮件,这是一个很大的问题。。我试着配置所有东西,但到目前为止没有任何效果 我有一个带有EuroDNS(nomdedomaine.fr)的域名,还有谷歌的电子邮件地址(gmail业务,考虑到name@nomdedomaine.fr) 我想要的是:只是从网站设置,你可以发送电子邮件,但不能通过相同的送货地址。例如:我不希望在site1.com上我们收到来自的电子邮件co

我在一个专用的服务器OVH(nsxxxxxxx.OVH.net)上工作,该服务器承载几个不同的站点(用PHP制作)。目前没有发送电子邮件,这是一个很大的问题。。我试着配置所有东西,但到目前为止没有任何效果

我有一个带有EuroDNS(nomdedomaine.fr)的域名,还有谷歌的电子邮件地址(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
nsxxxxxxx.ovh.net
/etc/mailname包含:

nsxxxxxxx.ovh
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
(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
May 3 14:00:40 nsxxxxxxx后缀/拾取[19451]:3CF87CC1F1:uid=0 from=
5月3日14:00:40 nsxxxxxxx后缀/清除[24287]:3CF87CC1F1:消息id=
5月3日14:00:40 nsxxxxxxx后缀/qmgr[12155]:3CF87CC1F1:from=,size=368,nrcpt=1(队列活动)
5月3日14:00:40 nsxxxxxxx后缀/smtp[24289]:3CF87CC1F1:to=,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=bounched(主机smtp.yopmail.com[87.98.164.155]表示:550无法路由的发件人地址(回复RCPT命令))
5月3日14:00:40 nsxxxxxxx后缀/清除[24287]:641A3CC1F2:消息id=
5月3日14:00:40 nsxxxxxxx后缀/跳转[24290]:3CF87CC1F1:发件人未送达通知:641A3CC1F2
5月3日14:00:40 nsxxxxxxx后缀/qmgr[12155]:641A3CC1F2:from=,size=2260,nrcpt=1(队列活动)
5月3日14:00:40 nsxxxxxxx 018962后缀/qmgr[12155]:3CF87CC1F1:已删除
5月3日14:00:40 nsxxxxxxx后缀/错误[24291]:641A3CC1F2:to=,中继=无,延迟=0.07,延迟=0.03/0.02/0/0.03,dsn=5.1.3,状态=已反弹(错误地址语法)
5月3日14:00:40 nsxxxxxxx后缀/qmgr[12155]:641A3CC1F2:已删除

我发现自己有点卡住了。。我怀疑配置不正确,但这对我来说太模糊了。。需要一个慈善的灵魂:)

dpkg重新配置postfix
并选择internet选项。我有5个选项,其中有2个“internet”选项:无配置、internet站点、带smarthost的internet、卫星系统、仅限本地。我必须选择“带smarthost的Internet”?我想是“Internet站点”。默认情况下,如果您没有重新配置它,它是“仅本地”的。
dpkg重新配置后缀
并选择internet选项。我有5个选项,其中有2个“internet”选项:无配置、internet站点、带smarthost的internet、卫星系统、仅本地。我必须选择“带smarthost的Internet”?我想是“Internet站点”。默认情况下,如果您没有重新配置它,它将处于“仅本地”状态。