好吧,我试图从我的Ubuntu服务器(让我们称之为example.com)邮件转发到外部Gmail邮箱帐户使用后缀。
问题是,当我使用其他Gmail和雅虎帐户邮件发送到[email protected],我检查var/log/mail.info ,什么都没有显示。
但是,当我在terminal中使用sendmail并发送到相同的地址时,我将以下内容写入日志以及实际发送的邮件,并在收件箱中结束:
Jan 4 00:02:48 Machine postfix/local[6520]: 6C82DB80C4A: to=<[email protected]>, relay=local, delay=0.01, delays=0/0/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION") Jan 4 00:02:48 Machine postfix/qmgr[6497]: 6C82DB80C4A: removed Jan 4 00:09:58 Machine postfix/pickup[6496]: B206CB80C46: uid=0 from=<root> Jan 4 00:09:58 Machine postfix/cleanup[6540]: B206CB80C46: message-id=<20140104050958.B206CB80C46@Machine> Jan 4 00:09:58 Machine postfix/qmgr[6497]: B206CB80C46: from=<[email protected]>, size=265, nrcpt=1 (queue active) Jan 4 00:09:59 nightMachine postfix/smtp[6542]: B206CB80C46: to=<[email protected]>, orig_to=<[email protected]>, relay=gmail-smtp-in.l.google.com[74.125.142.26]:25, delay=14, delays=13/0/0.22/0.69, dsn=2.0.0, status=sent (250 2.0.0 OK 1388812199 qd7si6471164igb.62 - gsmtp) Jan 4 00:09:59 Machine postfix/qmgr[6497]: B206CB80C46: removed
是否有一个原因? 我将如何解决它?
我正在按照这个教程。
后缀/虚拟:
[email protected] [email protected]
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 (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 = Machine alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = example.com, Machine, localhost.localdomain, localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all home_mailbox = mail/ #added the following for mail server :O!! virtual_alias_domains = example.com virtual_alias_maps = hash:/etc/postfix/virtual
当我在terminal上执行dig example.com mx查询的结果:
;; ANSWER SECTION: example.com. 21600 IN MX 10 mail.example.com.
telnet example.com 25
Connected to example.com. Escape character is '^]'. 220 Machine ESMTP Postfix (Ubuntu)
您已将MXlogging设置为“mail.example.com”。 这意味着,当任何邮件服务器试图发送邮件给你,他们将做一个DNS查找findmail.example.com。 由于这不存在,发送系统不知道在哪里发送电子邮件。
要解决此问题,请执行以下两项操作之一:
它应该看起来像他的一个logging:
mail A 127.0.0.1
(当然除了IP地址应该是服务器的实际IP,而不是回送地址)
像这样一个CNAME:
mail CNAME example.com.