后缀邮件(作品),除了我在debian上的域名

我已经build立了一个从turnkey linux获得的redmine服务器。 邮件或多或less的开箱即用。 我可以邮寄给任何不在我的域名的人。

让我解释:
如果我从命令行运行邮件命令,并发送到我的个人电子邮件(或任何其他非域电子邮件)它的作品。 如果我邮寄给我的域名中的任何人,则不会。 我们的邮件由Google处理并find。 出于某种原因,这台机器看到的域名,并试图处理它本身(我不想)。 我只想让邮件走向谷歌(或任何地方)的自然之路。 我有一种感觉,如果我把机器的领域改成了我的东西(这对我来说没问题),它会开始正常工作。 我尝试过这样做,但认为我错过了一个。 非常感激任何的帮助!

我以为也许改变域可能会欺骗后缀。 我更改了主机名文件:

redmine.hsi.com 

这是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. myhostname = redmine alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases mydestination = localdomain, localhost, localhost.localdomain, localhost mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = localhost smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_password_map 

这是master.cf:

 # # Postfix master process configuration file. For details on the format # of the file, see the master(5) manual page (command: "man 5 master"). # # Do not forget to execute "postfix reload" after editing this file. # # ========================================================================== # service type private unpriv chroot wakeup maxproc command + args # (yes) (yes) (yes) (never) (100) # ========================================================================== smtp inet n - - - - smtpd #smtp inet n - - - 1 postscreen #smtpd pass - - - - - smtpd #dnsblog unix - - - - 0 dnsblog #tlsproxy unix - - - - 0 tlsproxy #submission inet n - - - - smtpd # -o syslog_name=postfix/submission # -o smtpd_tls_security_level=encrypt # -o smtpd_sasl_auth_enable=yes # -o smtpd_client_restrictions=permit_sasl_authenticated,reject # -o milter_macro_daemon_name=ORIGINATING #smtps inet n - - - - smtpd # -o syslog_name=postfix/smtps # -o smtpd_tls_wrappermode=yes # -o smtpd_sasl_auth_enable=yes # -o smtpd_client_restrictions=permit_sasl_authenticated,reject # -o milter_macro_daemon_name=ORIGINATING #628 inet n - - - - qmqpd pickup fifo n - - 60 1 pickup cleanup unix n - - - 0 cleanup qmgr fifo n - n 300 1 qmgr #qmgr fifo n - n 300 1 oqmgr tlsmgr unix - - - 1000? 1 tlsmgr rewrite unix - - - - - trivial-rewrite bounce unix - - - - 0 bounce defer unix - - - - 0 bounce trace unix - - - - 0 bounce verify unix - - - - 1 verify flush unix n - - 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - - - - smtp relay unix - - - - - smtp # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 showq unix n - - - - showq error unix - - - - - error retry unix - - - - - error discard unix - - - - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - - - - lmtp anvil unix - - - - 1 anvil scache unix - - - - 1 scache # # ==================================================================== # Interfaces to non-Postfix software. Be sure to examine the manual # pages of the non-Postfix software to find out what options it wants. # # Many of the following services use the Postfix pipe(8) delivery # agent. See the pipe(8) man page for information about ${recipient} # and other message envelope options. # ==================================================================== # # maildrop. See the Postfix MAILDROP_README file for details. # Also specify in main.cf: maildrop_destination_recipient_limit=1 # maildrop unix - nn - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} # # ==================================================================== # # Recent Cyrus versions can use the existing "lmtp" master.cf entry. # # Specify in cyrus.conf: # lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4 # # Specify in main.cf one or more of the following: # mailbox_transport = lmtp:inet:localhost # virtual_transport = lmtp:inet:localhost # # ==================================================================== # # Cyrus 2.1.5 (Amos Gouaux) # Also specify in main.cf: cyrus_destination_recipient_limit=1 # #cyrus unix - nn - - pipe # user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user} # # ==================================================================== # Old example of delivery via Cyrus. # #old-cyrus unix - nn - - pipe # flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} # # ==================================================================== # # See the Postfix UUCP_README file for configuration details. # uucp unix - nn - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) # # Other external delivery methods. # ifmail unix - nn - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - nn - - pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient scalemail-backend unix - nn - 2 pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} mailman unix - nn - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user} 

这里是mail.log

 Feb 27 21:13:13 redmine postfix/pickup[15860]: 56D53C0D32: uid=0 from=<[email protected]> Feb 27 21:13:13 redmine postfix/cleanup[19150]: 56D53C0D32: message-id=<20150227211313.56D53C0D32@redmine> Feb 27 21:13:13 redmine postfix/qmgr[15861]: 56D53C0D32: from=<[email protected]>, size=349, nrcpt=1 (queue active) Feb 27 21:13:13 redmine postfix/smtp[19159]: 56D53C0D32: to=<[email protected]>, relay=none, delay=0.06, delays=0.05/0.01/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=humansolutionsinc.com type=AAAA: Host found but no data record of requested type) Feb 27 21:13:13 redmine postfix/cleanup[19150]: 5E24FC0D33: message-id=<20150227211313.5E24FC0D33@redmine> Feb 27 21:13:13 redmine postfix/qmgr[15861]: 5E24FC0D33: from=<>, size=2276, nrcpt=1 (queue active) Feb 27 21:13:13 redmine postfix/bounce[19166]: 56D53C0D32: sender non-delivery notification: 5E24FC0D33 Feb 27 21:13:13 redmine postfix/qmgr[15861]: 56D53C0D32: removed Feb 27 21:13:13 redmine postfix/smtp[19159]: 5E24FC0D33: to=<[email protected]>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=redmine.hsi.com type=AAAA: Host not found) Feb 27 21:13:13 redmine postfix/qmgr[15861]: 5E24FC0D33: removed 

这里是mail.info:

 Feb 27 21:13:13 redmine postfix/pickup[15860]: 56D53C0D32: uid=0 from=<[email protected]> Feb 27 21:13:13 redmine postfix/cleanup[19150]: 56D53C0D32: message-id=<20150227211313.56D53C0D32@redmine> Feb 27 21:13:13 redmine postfix/qmgr[15861]: 56D53C0D32: from=<[email protected]>, size=349, nrcpt=1 (queue active) Feb 27 21:13:13 redmine postfix/smtp[19159]: 56D53C0D32: to=<[email protected]>, relay=none, delay=0.06, delays=0.05/0.01/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=humansolutionsinc.com type=AAAA: Host found but no data record of requested type) Feb 27 21:13:13 redmine postfix/cleanup[19150]: 5E24FC0D33: message-id=<20150227211313.5E24FC0D33@redmine> Feb 27 21:13:13 redmine postfix/qmgr[15861]: 5E24FC0D33: from=<>, size=2276, nrcpt=1 (queue active) Feb 27 21:13:13 redmine postfix/bounce[19166]: 56D53C0D32: sender non-delivery notification: 5E24FC0D33 Feb 27 21:13:13 redmine postfix/qmgr[15861]: 56D53C0D32: removed Feb 27 21:13:13 redmine postfix/smtp[19159]: 5E24FC0D33: to=<[email protected]>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=redmine.hsi.com type=AAAA: Host not found) Feb 27 21:13:13 redmine postfix/qmgr[15861]: 5E24FC0D33: removed 

正如Tutul所build议的那样,我在main.cf中添加了以下代码,重新启动了postfix,然后尝试重新发送电子邮件,结果如下:通过电子邮件发送到除humanolutionsinc.com之外的任何其他域,这些域名中的任何人都不会。

 inet_protocols=ipv4 

这里是dig humansolutionsinc.com的输出:

 root@redmine ~# dig humansolutionsinc.com ; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> humansolutionsinc.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31920 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;humansolutionsinc.com. IN A ;; AUTHORITY SECTION: humansolutionsinc.com. 3600 IN SOA hsiwd1.hsi.com. hostmaster.hsi.com. 5 900 600 86400 3600 ;; Query time: 1 msec ;; SERVER: 192.168.1.4#53(192.168.1.4) ;; WHEN: Mon Mar 2 14:03:05 2015 ;; MSG SIZE rcvd: 97 

和dig的输出humanolutionsinc.com mx:

 root@redmine ~# dig humansolutionsinc.com mx ; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> humansolutionsinc.com mx ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36172 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;humansolutionsinc.com. IN MX ;; AUTHORITY SECTION: humansolutionsinc.com. 3600 IN SOA hsiwd1.hsi.com. hostmaster.hsi.com. 5 900 600 86400 3600 ;; Query time: 1 msec ;; SERVER: 192.168.1.4#53(192.168.1.4) ;; WHEN: Mon Mar 2 14:03:13 2015 ;; MSG SIZE rcvd: 97 

大! 经过一系列的重新启动(追逐其他问题 – 与邮件无关) 没有邮件正在发送

好的,回到原点。 我把/ etc / host和/ etc / hots改成了redmine(没有域名)。我后来把它们改回redmine.hsi.com并运行:

 invoke-rc.d hostname.sh start invoke-rc.d networking force-reload 

修复你的NS服务器192.168.1.4。 它应该返回适​​当的MX和Alogging,而不是像上面那样空的答案。

说明:

这些日志行

 Feb 27 21:13:13 redmine postfix/pickup[15860]: 56D53C0D32: uid=0 from=<[email protected]> Feb 27 21:13:13 redmine postfix/cleanup[19150]: 56D53C0D32: message-id=<20150227211313.56D53C0D32@redmine> Feb 27 21:13:13 redmine postfix/qmgr[15861]: 56D53C0D32: from=<[email protected]>, size=349, nrcpt=1 (queue active) Feb 27 21:13:13 redmine postfix/smtp[19159]: 56D53C0D32: to=<[email protected]>, relay=none, delay=0.06, delays=0.05/0.01/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=humansolutionsinc.com type=AAAA: Host found but no data record of requested type) 

告诉我们一封由mail发送的mail ,发件人为[email protected]和收件人[email protected]

因为在mydestination参数中没有定义域名为humanolutionsinc.com ,所以postfix会将这个域名标记为输出域名,因此postfix必须通过远程SMTP发送。 为了确定负责人的邮件服务器solutionsolutionsinc.com ,postfix特别使用DNS查找searchMXlogging(和可选的Alogging)。 我们可以使用命令dig来模拟NS查找。

这里是从我的服务器(适当的)挖掘输出

 $ dig humansolutionsinc.com ; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1 <<>> humansolutionsinc.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12591 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;humansolutionsinc.com. IN A ;; ANSWER SECTION: humansolutionsinc.com. 1199 IN A 98.136.187.13 ;; Query time: 1508 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Mon Mar 02 19:21:03 WIB 2015 ;; MSG SIZE rcvd: 66 

 $ dig humansolutionsinc.com MX ; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1 <<>> humansolutionsinc.com MX ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35479 ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;humansolutionsinc.com. IN MX ;; ANSWER SECTION: humansolutionsinc.com. 599 IN MX 10 aspmx.l.google.com. humansolutionsinc.com. 599 IN MX 20 alt1.aspmx.l.google.com. humansolutionsinc.com. 599 IN MX 20 alt2.aspmx.l.google.com. humansolutionsinc.com. 599 IN MX 30 aspmx2.googlemail.com. humansolutionsinc.com. 599 IN MX 30 aspmx3.googlemail.com. ;; Query time: 942 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Mon Mar 02 19:21:08 WIB 2015 ;; MSG SIZE rcvd: 180 

与我的版本比较,您的挖掘输出包含零答案

这就解释了为什么后缀抱怨像一般的消息

主机或域名未find。 Name = humanolutionsinc.com的名称服务错误type = AAAA: find主机,但没有请求types的数据logging

首先,Postfix将查找MXlogging,如果失败,它将通过查找Alogging(IPv4)和AAAAlogging(IPv6)来回退。 由于postfix无法从上面的三条logging中find您的域的目标主机,所以postfix退回了您的电子邮件。

尝试将myhostname更改为其他内容 – 例如mail.redmine.hsi.com