免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8785 | 回复: 9

[Mail] 请教:postfix+dovecot无法正常收发邮件? [复制链接]

论坛徽章:
0
发表于 2013-07-12 22:22 |显示全部楼层
本帖最后由 zhxd 于 2013-07-15 16:52 编辑

环境:CentOS6.4+postfix+dovecot搭建了邮件系统。
由于是在服务器上的虚拟机上进行演示的,所以虚拟机对外映射了这几个端口:
25,143,110,993,995。
在外网测试这个公网IP,25,143,110,993,995等端口已经开放。

通过web能登陆到每个用户的邮箱,但是用户无法正常收邮件。
(包括自己给自己发,自己给同域的用户发均无法正常收到,但是发给其他域的邮件可以正常收到,外部域发进来的邮件状态显示已经到达本地邮件服务器了,但收件箱没有邮件)。

以下为maillog,其中abc和root为手工创建的一个普通用户:
Jul 12 22:13:56 localhost dovecot: auth: mysql: Connected to localhost (postfix)
Jul 12 22:13:56 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1573, secured
Jul 12 22:13:56 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=50/410
Jul 12 22:14:02 localhost master[1575]: fatal: master_spawn: exec /usr/libexec/postfix/pipe,: No such file or directory
Jul 12 22:14:03 localhost postfix/master[1304]: warning: process /usr/libexec/postfix/pipe, pid 1575 exit status 1
Jul 12 22:14:03 localhost postfix/master[1304]: warning: /usr/libexec/postfix/pipe,: bad command startup -- throttling
Jul 12 22:14:21 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1578, secured
Jul 12 22:14:21 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=32/390
Jul 12 22:14:26 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1582, secured
Jul 12 22:14:26 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=44/401
Jul 12 22:14:28 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1586, secured
Jul 12 22:14:28 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=32/390
Jul 12 22:14:28 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1589, secured
Jul 12 22:14:28 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=44/401
Jul 12 22:14:29 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1591, secured
Jul 12 22:14:29 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=32/390
Jul 12 22:14:29 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1593, secured
Jul 12 22:14:29 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=32/390
Jul 12 22:14:38 localhost postfix/smtpd[1596]: connect from localhost[127.0.0.1]
Jul 12 22:14:38 localhost postfix/smtpd[1596]: 710DCDB05: client=localhost[127.0.0.1], sasl_method=CRAM-MD5, sasl_username=abc@aabbcc.net
Jul 12 22:14:38 localhost postfix/cleanup[1601]: 710DCDB05: message-id=<92272a30c01d231a0d0f917c49f84cb1@aabbcc.net>
Jul 12 22:14:38 localhost postfix/qmgr[1313]: 710DCDB05: from=<abc@aabbcc.net>, size=516, nrcpt=1 (queue active)
Jul 12 22:14:38 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1603, secured
Jul 12 22:14:38 localhost dovecot: dict: mysql: Connected to localhost (postfix)
Jul 12 22:14:38 localhost postfix/smtpd[1596]: disconnect from localhost[127.0.0.1]
Jul 12 22:14:38 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=431/505
Jul 12 22:14:39 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1608, secured
Jul 12 22:14:39 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=70/511
Jul 12 22:14:39 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1614, secured
Jul 12 22:14:39 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=50/410
Jul 12 22:14:39 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1615, secured
Jul 12 22:14:39 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=82/469
Jul 12 22:14:41 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1618, secured
Jul 12 22:14:41 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=50/410
Jul 12 22:14:55 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1621, secured
Jul 12 22:14:55 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=32/390
Jul 12 22:14:55 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1624, secured
Jul 12 22:14:55 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=44/401
Jul 12 22:15:03 localhost master[1626]: fatal: master_spawn: exec /usr/libexec/postfix/pipe,: No such file or directory
Jul 12 22:15:04 localhost postfix/master[1304]: warning: process /usr/libexec/postfix/pipe, pid 1626 exit status 1
Jul 12 22:15:04 localhost postfix/master[1304]: warning: /usr/libexec/postfix/pipe,: bad command startup -- throttling
Jul 12 22:15:04 localhost postfix/smtpd[1596]: connect from localhost[127.0.0.1]
Jul 12 22:15:04 localhost postfix/smtpd[1596]: C2FC2DB06: client=localhost[127.0.0.1], sasl_method=CRAM-MD5, sasl_username=abc@aabbcc.net
Jul 12 22:15:04 localhost postfix/cleanup[1601]: C2FC2DB06: message-id=<1b3d48564c6170c3aab2d94b94401264@aabbcc.net>
Jul 12 22:15:04 localhost postfix/qmgr[1313]: C2FC2DB06: from=<abc@aabbcc.net>, size=518, nrcpt=1 (queue active)
Jul 12 22:15:04 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1634, secured
Jul 12 22:15:04 localhost dovecot: dict: mysql: Connected to localhost (postfix)
Jul 12 22:15:04 localhost postfix/smtpd[1596]: disconnect from localhost[127.0.0.1]
Jul 12 22:15:04 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=432/505
Jul 12 22:15:05 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1638, secured
Jul 12 22:15:05 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=70/511
Jul 12 22:15:06 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1643, secured
Jul 12 22:15:06 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=82/469
Jul 12 22:15:06 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1644, secured
Jul 12 22:15:06 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=50/410

以上日志当中:52.0.13.14为公网IP地址,192.168.5.129为虚拟机的IP。
25,143,110,993,995等端口已经映射出来了(80映射出来为81,真实服务器没有开放什么端口,所以25,143,110,993,995等端口映射出来的也是这些端口)。

tail盯着日志不停地看,发现不断有:
Jul 12 23:52:27 localhost dovecot: imap-login: Login: user=<root@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1899
Jul 12 23:52:27 localhost dovecot: imap(root@aabbcc.net): Disconnected: Logged out bytes=50/410
Jul 12 23:52:52 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1902
Jul 12 23:52:52 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=158/903


下面是从QQ邮箱发邮件过来时候的日志:
Jul 13 00:18:52 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1455
Jul 13 00:18:52 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=158/903
Jul 13 00:19:03 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1458
Jul 13 00:19:03 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=158/903
Jul 13 00:19:16 localhost postfix/smtpd[1459]: connect from smtpbg129.qq.com[183.60.2.225]
Jul 13 00:19:16 localhost postfix/smtpd[1459]: C24B7DB0C: client=smtpbg129.qq.com[183.60.2.225]
Jul 13 00:19:16 localhost postfix/cleanup[1465]: C24B7DB0C: message-id=<tencent_09E57C2F7B4422956B13F134@qq.com>
Jul 13 00:19:16 localhost postfix/qmgr[1339]: C24B7DB0C: from=<12345678@qq.com>, size=1805, nrcpt=1 (queue active)
Jul 13 00:19:16 localhost postfix/smtpd[1459]: disconnect from smtpbg129.qq.com[183.60.2.225]
Jul 13 00:19:31 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1468
Jul 13 00:19:31 localhost dovecot: dict: mysql: Connected to localhost (postfix)
Jul 13 00:19:31 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=70/511
Jul 13 00:19:36 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1475
Jul 13 00:19:36 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=119/536
Jul 13 00:19:36 localhost dovecot: imap-login: Login: user=<abc@aabbcc.net>, method=CRAM-MD5, rip=52.0.13.14, lip=192.168.5.129, mpid=1476
Jul 13 00:19:36 localhost dovecot: imap(abc@aabbcc.net): Disconnected: Logged out bytes=50/410


用QQ邮箱发邮件测试,邮件的状态显示为“已投递到对方服务器”,应该邮件是已经过来了,但没有到用户的邮箱。
百思不得其解,还请搭建过邮件系统的朋友帮忙分析一下错误原因。
先谢过了。

论坛徽章:
4
IT运维版块每日发帖之星
日期:2015-09-01 06:20:00IT运维版块每日发帖之星
日期:2015-10-09 06:20:00操作系统版块每日发帖之星
日期:2015-10-20 06:20:00IT运维版块每日发帖之星
日期:2015-11-03 06:20:00
发表于 2013-07-13 11:27 |显示全部楼层
加QQ1474804934,解决

论坛徽章:
0
发表于 2013-07-15 11:36 |显示全部楼层
没有其他朋友知道吗?

论坛徽章:
0
发表于 2013-07-16 10:53 |显示全部楼层
你说的“到达本地邮件服务器了,但收件箱没有邮件”很可能是dovecot中 mail_location 设置与 postfix 邮件存放位置不一致造成的,

一个简单的例子:
postfix中定义的虚拟用户邮件存放位置
main.cf
virtual_mailbox_base = /var/vmail/

又如果用户邮件存放格式为 /var/vmail/domain_name/user_name,则dovecot设置为
10-mail.conf
mail_location = maildir:/var/vmail/%d/%n

你可以根据你自己的环境做下改动,两者要一致,不然即使收postfix收到信,客户端也看不到

论坛徽章:
0
发表于 2013-08-31 16:38 |显示全部楼层
main.cf里面看看,是不是找不到存放邮箱的路径
home_mailbox = Maildir/

QQ:524813834 欢迎交流

论坛徽章:
0
发表于 2019-01-24 14:46 |显示全部楼层
exec /usr/libexec/postfix/pipe,: No such file or directory

pipe  

#修改master.cf文件
[root@mail ~]# vim /etc/postfix/master.cf
#在最后增加这两行,注意flags前面有两个空格,不然会报错
dovecot   unix  -       n       n       -       -       pipe,
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f ${sender} -d ${recipient}



ok
.............

论坛徽章:
0
发表于 2019-01-24 14:48 |显示全部楼层
solve the problem

论坛徽章:
0
发表于 2019-01-24 14:54 |显示全部楼层

#修改master.cf文件     qq651830056
[root@mail ~]# vim /etc/postfix/master.cf
#在最后增加这两行,注意flags前面有两个空格,不然会报错
dovecot   unix  -       n       n       -       -       pipe,
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f ${sender} -d ${recipient}

论坛徽章:
0
发表于 2019-01-24 15:07 |显示全部楼层
#修改master.cf文件  q651830056
[root@mail ~]# vim /etc/postfix/master.cf
#在最后增加这两行,注意flags前面有两个空格,不然会报错
dovecot   unix  -       n       n       -       -       pipe,
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f ${sender} -d ${recipient}
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

DTCC2020中国数据库技术大会 限时8.5折

【架构革新 高效可控】2020年6月4日~6日第十一届中国数据库技术大会将在北京隆重召开。

大会设置2大主会场,20+技术专场,将邀请超百位行业专家,重点围绕数据架构、AI与大数据、传统企业数据库实践和国产开源数据库等内容展开分享和探讨,为广大数据领域从业人士提供一场年度盛会和交流平台。

http://dtcc.it168.com


大会官网>>
  

北京盛拓优讯信息技术有限公司. 版权所有 16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122
中国互联网协会会员  联系我们:huangweiwei@it168.com
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP