Postfix + PHP将发送到本地域的电子邮件地址转换为[email protected]

我在这里的第一个问题,如果我不能立即提供足够的信息,请降低对我的容易;-)

我正在使用OpenVZ运行由afterburst.com托pipe的VPS

我成功安装并configuration了以下组件:

zpanel (with apache, mysql, php5.3, postfix) updated successfully to php5.4 running Laravel on secundary webpage (works fine) 

发送电子邮件与PHP以及与MUAs工作正常。 从MUA发送到本地托pipe域的电子邮件也可以正常工作。

但是这里是错误的:

当我使用php sendmail命令向本地托pipe的域发送电子邮件时,电子邮件地址被转换为[email protected]。 我相信这与我的DNS设置有关,但是我尝试了很多东西,但是我找不到正确的答案

我的主机名是

 [user@vps ~]# hostname vps.krause-it-consulting.com 

这里是我的后缀configuration(postconf -n):

 alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases broken_sasl_auth_clients = yes command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix debug_peer_level = 2 delay_warning_time = 4 disable_vrfy_command = yes html_directory = no inet_interfaces = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = vps.$mydomain mydomain = krause-it-consulting.com myhostname = vps.krause-it-consulting.com mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 VPS_IP newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.2.2/README_FILES recipient_delimiter = + relay_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-relay_domains_maps .cf sample_directory = /usr/share/doc/postfix-2.2.2/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_host_lookup = dns, native smtp_use_tls = no smtpd_client_restrictions = smtpd_data_restrictions = reject_unauth_pipelining smtpd_helo_required = yes smtpd_helo_restrictions = smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetwor ks, reject_unauth_destination, reject_non_fqdn_recipient, r eject_unknown_recipient_domain smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_sender_restrictions = smtpd_use_tls = no soft_bounce = yes transport_maps = hash:/etc/postfix/transport unknown_local_recipient_reject_code = 550 virtual_alias_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_alias _maps.cf, regexp:/etc/zpanel/configs/postfix/virtual_regexp virtual_gid_maps = static:12 virtual_mailbox_base = /var/zpanel/vmail virtual_mailbox_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_ domains_maps.cf virtual_mailbox_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_mai lbox_maps.cf virtual_minimum_uid = 101 virtual_transport = dovecot virtual_uid_maps = static:101 

如果您需要更多信息,请询问我将添加。

最后我想强调的是, 只有通过php和sendmail命令发送的电子邮件是这里的问题 。 一切工作正常(到目前为止:-))

考虑到在这个问题上写下问题的细节之后,我在过去的两个星期里一直在研究这个问题,终于能够解决了。

这实际上是我在hosts文件中导致这个问题的一个条目。 也许我玩的太多了:-)

无论如何,这是问题线:

 127.0.0.1 localhost.localdomain localhost vps.krause-it-consulting.com krause-it-consulting.com hobbyathletes.com 

删除了我的托pipe域的2个增加后,它的工作:正确的行:

  127.0.0.1 localhost.localdomain localhost vps.krause-it-consulting.com 

无论如何,我希望这将有助于某人。