当web服务器configuration为使用mx服务器发送时,mxlogging服务器将电子邮件发送回web服务器

我有我的networking服务器运行一个networking邮件客户端。 我有这个webmail客户端configuration为使用单独的独立邮件服务器发送电子邮件。 我可以成功地从这个networking邮件发送电子邮件到Gmail。

但是,在尝试将电子邮件发送到我自己的域上的地址时,可以看到我连接到独立服务器以发送电子邮件作为日志状态:

Nov 12 12:47:46 mx dovecot: imap([email protected]): Disconnected: Logged out in=291 out=2751 Nov 12 12:48:46 mx dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=192.168.1.11, lip=192.168.1.12, mpid=19294, TLS, session=<6pT3wzxd4QrAqAoM> Nov 12 12:48:46 mx dovecot: imap([email protected]): Disconnected: Logged out in=291 out=2751 

但是,而不是mx服务器本身接收电子邮件,就像从其他领域,即Gmail等来的电子邮件,电子邮件似乎收到的邮件日志显示的Web服务器:

 Nov 12 12:27:12 myservername postfix/pickup[29249]: 3210A1020814: uid=56 from=<[email protected]> Nov 12 12:27:12 myservername postfix/cleanup[29254]: 3210A1020814: message-id=<[email protected]> Nov 12 12:27:12 myservername postfix/qmgr[29250]: 3210A1020814: from=<[email protected]>, size=532, nrcpt=1 (queue active) Nov 12 12:27:12 myservername postfix/local[29256]: 3210A1020814: to=<[email protected]>, relay=local, delay=0.09, delays=0.06/0/0/0.03, dsn=5.1.1, status=bounced (unknown user: "sender") Nov 12 12:27:12 myservername postfix/cleanup[29254]: 3F1291020816: message-id=<[email protected]> Nov 12 12:27:12 myservername postfix/bounce[29257]: 3210A1020814: sender non-delivery notification: 3F1291020816 Nov 12 12:27:12 myservername postfix/qmgr[29250]: 3F1291020816: from=<>, size=2288, nrcpt=1 (queue active) Nov 12 12:27:12 myservername postfix/qmgr[29250]: 3210A1020814: removed Nov 12 12:27:12 myservername postfix/local[29256]: 3F1291020816: to=<[email protected]>, relay=local, delay=0.05, delays=0.03/0/0/0.03, dsn=5.1.1, status=bounced (unknown user: "sender") Nov 12 12:27:12 myservername postfix/qmgr[29250]: 3F1291020816: removed 

main.cf for postfix:

 # 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 (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 myorigin = /etc/mailname mydestination = mydomain.com, localhost.com, , localhost 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 smtp_tls_security_level = may 

我怎么能得到我的mxlogging被configuration为发送我的webmail服务器邮件客户端通过它发送到自己的电子邮件,而不是回到web服务器的独立的邮件服务器?

您已经在您的Web服务器上configuration了Postfix,相信它可以通过设置myhostname = mydomain.com来处理您的域的所有传入邮件。 有了这个设置,Postfix将总是尝试在本地为指定的域提供邮件。

这显然不是你想要的。

相反,您应该简单地删除此设置,这将导致Postfix使用系统主机名(而不是设置为裸域名),从而根据其MXlogging为域传递邮件。