当前位置: 技术问答>linux和unix
postfix收不到邮件
来源: 互联网 发布时间:2017-01-20
本文导语: main.cf配置如下: soft_bounce = no queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix mail_owner = postfix default_privs = appbat myhostname = xxx.xxx mydomain = xxx.xxx myorigin = $mydomain inet_interfaces =...
main.cf配置如下:
soft_bounce = no
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
default_privs = appbat
myhostname = xxx.xxx
mydomain = xxx.xxx
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
unknown_local_recipient_reject_code = 550
mynetworks_style = host
mynetworks = 127.0.0.0/8, 172.17.17.0/24, 172.19.177.111
relay_domains =
relayhost = 172.19.177.111
in_flow_delay = 1s
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mail_spool_directory =
header_checks = regexp:/etc/postfix/header_checks
fast_flush_domains = $relay_domains
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
maximal_queue_lifetime = 5d
allow_min_user = yes
transport_maps = hash:/etc/postfix/transport
header_checks就一句话:
/^To:.*/ OK
post运行状态:
ps aux | grep postfix
postfix 1020 0.0 0.1 59204 2896 ? S 13:28 0:00 pickup -l -t fifo -u
root 1562 0.0 0.1 54032 2224 ? Ss Nov20 0:00 /usr/libexec/postfix/master
postfix 1573 0.0 0.1 59264 3024 ? S Nov20 0:00 qmgr -l -t fifo -u
13331 1980 0.0 0.0 66136 796 pts/1 S+ 14:20 0:00 grep postfix
测试postfix:
[nie@mail ~]$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 xxx.xxx ESMTP Postfix
mail from:localhost
250 2.1.0 Ok
rcpt to:xxx@163.com
250 2.1.5 Ok
data
354 End data with .
subject:mail test
this is just a test mail
.
250 2.0.0 Ok: queued as 6030B182775
quit
221 2.0.0 Bye
Connection closed by foreign host.
maillog:
Nov 22 19:42:38 xxx postfix/smtpd[12123]: connect from localhost.localdomain[127.0.0.1]
Nov 22 19:44:18 xxx postfix/smtpd[12123]: F30F7182775: client=localhost.localdomain[127.0.0.1]
Nov 22 19:44:41 xxx postfix/cleanup[12126]: F30F7182775: message-id=
Nov 22 19:44:41 xxx postfix/qmgr[1573]: F30F7182775: from=, size=380, nrcpt=1 (queue active)
Nov 22 19:44:41 xxx postfix/smtp[12127]: F30F7182775: to=, relay=172.19.17.11[172.19.17.11]:25, delay=61, delays=60/0.08/0.04/0.03, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 9FB4A2600A6)
Nov 22 19:44:41 xxx postfix/qmgr[1573]: F30F7182775: removed
Nov 22 19:44:54 xxx postfix/smtpd[12123]: disconnect from localhost.localdomain[127.0.0.1]
从log来看的话 应该是没有问题的。但邮件确实没收到。
请各位大哥看看。先行谢过。
soft_bounce = no
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
default_privs = appbat
myhostname = xxx.xxx
mydomain = xxx.xxx
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
unknown_local_recipient_reject_code = 550
mynetworks_style = host
mynetworks = 127.0.0.0/8, 172.17.17.0/24, 172.19.177.111
relay_domains =
relayhost = 172.19.177.111
in_flow_delay = 1s
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mail_spool_directory =
header_checks = regexp:/etc/postfix/header_checks
fast_flush_domains = $relay_domains
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
maximal_queue_lifetime = 5d
allow_min_user = yes
transport_maps = hash:/etc/postfix/transport
header_checks就一句话:
/^To:.*/ OK
post运行状态:
ps aux | grep postfix
postfix 1020 0.0 0.1 59204 2896 ? S 13:28 0:00 pickup -l -t fifo -u
root 1562 0.0 0.1 54032 2224 ? Ss Nov20 0:00 /usr/libexec/postfix/master
postfix 1573 0.0 0.1 59264 3024 ? S Nov20 0:00 qmgr -l -t fifo -u
13331 1980 0.0 0.0 66136 796 pts/1 S+ 14:20 0:00 grep postfix
测试postfix:
[nie@mail ~]$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 xxx.xxx ESMTP Postfix
mail from:localhost
250 2.1.0 Ok
rcpt to:xxx@163.com
250 2.1.5 Ok
data
354 End data with .
subject:mail test
this is just a test mail
.
250 2.0.0 Ok: queued as 6030B182775
quit
221 2.0.0 Bye
Connection closed by foreign host.
maillog:
Nov 22 19:42:38 xxx postfix/smtpd[12123]: connect from localhost.localdomain[127.0.0.1]
Nov 22 19:44:18 xxx postfix/smtpd[12123]: F30F7182775: client=localhost.localdomain[127.0.0.1]
Nov 22 19:44:41 xxx postfix/cleanup[12126]: F30F7182775: message-id=
Nov 22 19:44:41 xxx postfix/qmgr[1573]: F30F7182775: from=, size=380, nrcpt=1 (queue active)
Nov 22 19:44:41 xxx postfix/smtp[12127]: F30F7182775: to=, relay=172.19.17.11[172.19.17.11]:25, delay=61, delays=60/0.08/0.04/0.03, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 9FB4A2600A6)
Nov 22 19:44:41 xxx postfix/qmgr[1573]: F30F7182775: removed
Nov 22 19:44:54 xxx postfix/smtpd[12123]: disconnect from localhost.localdomain[127.0.0.1]
从log来看的话 应该是没有问题的。但邮件确实没收到。
请各位大哥看看。先行谢过。
|
你邮件怎么发的
|
这个不像是一个搞postfix的人问的问题啊,当然我在mail也不资深(只是写c发mail浅尝过)
简单说下mail简化可以看做A-smtp-pop3-B,而你的这种应该算是(A+smtp)-pop3-B
所以说当你的mail确实出去了,那问题的是在pop3是否受理了,
推荐个地址,至少当时我的问题全是上这个解决的
http://www.5dmail.net/bbs/thread-8907-1-1.html
http://www.5dmail.net/bbs/forum-38-1.html
你说的“要确认我本地的smtp postfix服务器是收到了邮件”。这句不是很理解。因为我上面的maillog显示,邮件一发送就remove了。
“其次一种pop3的链路端没通”这个的话可不可以讲的清楚一点。
1.就是说开始以为你有自己的发送client端,现在你确认在postfix上发那就不管
2.就是163可能不接受你的smtp,拦截掉了邮件,可以试试往其他邮箱发送,因为每个pop3处理都有可能不一样的