免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 10639 | 回复: 22
打印 上一主题 下一主题

[Mail] postfix测试端口的问题。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-06 16:28 |只看该作者 |倒序浏览
我配置了一个postfix邮件服务器,当测试25端口时结果如下:
[root@www admin]# telnet localhost 25
Trying 127.0.0.1...
Connected to www.oswardhead.com (127.0.0.1).
Escape character is '^]'.
到此处就不动了,没有出现:220 www.oswardhead.com ESMTP "Version not Available"
而且这个时候我退回不了终端,无法结束这段测试。小弟我是第一次配postfix,请问这大概是哪里出了错。谢谢!

当我测试POP3和IMAP时也遇到了问题:
[root@www root]# telnet localhost 110
Trying 127.0.0.1...
Connected to www.oswardhead.com (127.0.0.1).
Escape character is '^]'.
+OK Hello there.
USER oswardhead@oswardhead.com
+OK Password required.
PASS 1111                                                   (当输入错误密码时报密码错误)
-ERR Login failed.
PASS 123456                                               (当输入正确密码时,报错直接退出)
-ERR chdir oswardhead.com/oswardhead/ failed
Connection closed by foreign host.
[root@www root]#
请问这是什么原因造成的错误?
小弟才疏学浅希望各位达人们指点一二。

论坛徽章:
0
2 [报告]
发表于 2006-09-07 09:22 |只看该作者
把你的日志share一下,还有你的认证方式是什么!

论坛徽章:
0
3 [报告]
发表于 2006-09-07 12:21 |只看该作者
这是我打开服务器后启动httpd mysqld  postfix courier-authlib courier-imap,然后进行Telnet localhost 25所报的错误:
Sep  7 12:09:50 www authdaemond: modules="authmysql", daemons=5
Sep  7 12:09:50 www authdaemond: Installing libauthmysql
Sep  7 12:09:51 www authdaemond: Installation complete: authmysql
Sep  7 12:13:50 www postfix/postfix-script: starting the Postfix mail system
Sep  7 12:13:50 www postfix/master[1480]: daemon started -- version 2.2.3, configuration /etc/postfix
Sep  7 12:14:30 www postfix/smtpd[1510]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep  7 12:14:30 www postfix/smtpd[1510]: fatal: SASL per-process initialization failed
Sep  7 12:14:31 www postfix/master[1480]: warning: process /usr/libexec/postfix/smtpd pid 1510 exit status 1
Sep  7 12:14:31 www postfix/master[1480]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Sep  7 12:15:31 www postfix/smtpd[1557]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep  7 12:15:31 www postfix/smtpd[1557]: fatal: SASL per-process initialization failed
Sep  7 12:15:32 www postfix/master[1480]: warning: process /usr/libexec/postfix/smtpd pid 1557 exit status 1
Sep  7 12:15:32 www postfix/master[1480]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Sep  7 12:16:32 www postfix/smtpd[1558]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep  7 12:16:32 www postfix/smtpd[1558]: fatal: SASL per-process initialization failed
Sep  7 12:16:33 www postfix/master[1480]: warning: process /usr/libexec/postfix/smtpd pid 1558 exit status 1
Sep  7 12:16:33 www postfix/master[1480]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Sep  7 12:17:33 www postfix/smtpd[1559]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep  7 12:17:33 www postfix/smtpd[1559]: fatal: SASL per-process initialization failed
Sep  7 12:17:34 www postfix/master[1480]: warning: process /usr/libexec/postfix/smtpd pid 1559 exit status 1
Sep  7 12:17:34 www postfix/master[1480]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
我用的SASL认证

论坛徽章:
0
4 [报告]
发表于 2006-09-07 13:53 |只看该作者
可能是SASL的问题,没有安装LOGIN和PLAIN的认证模块。

可以重新编译安装SASL2,注意configure时选择PLAIN和LOGIN

论坛徽章:
0
5 [报告]
发表于 2006-09-07 14:07 |只看该作者
# ./configure \
--disable-anon -enable-plain --enable-login \
--enable-sql --with-mysql=/usr/local/mysql \
--with-mysql-includes=/usr/local/mysql/include/mysql \
--with-mysql-libs=/usr/local/mysql/lib/mysql \
--with-authdaemond
这是我安装SASL时的configure。我加上PLAIN和LOGIN了,main.cf文件里我也加上了smtpd_sasl_auth_enable = yes但是还是出现上述问题,到底是哪里出了问题啊?

论坛徽章:
0
6 [报告]
发表于 2006-09-07 14:14 |只看该作者
我将main.cf文件里的
smtpd_sasl_auth_enable = yes
这句话注掉就可以过去了,但是这样的话SASL认证就不起作用了吧?请问这是哪里出了问题?
现在telnet能进行到下面这步:
#telnet localhost 25
Trying 127.0.0.1...
Connected to www.oswardhead.com (127.0.0.1).
Escape character is '^]'.
220 localhost ESMTP "Version not Available"
ehlo www.oswardhead.com
250-localhost
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250 8BITMIME

[ 本帖最后由 oswardhead 于 2006-9-7 14:21 编辑 ]

论坛徽章:
0
7 [报告]
发表于 2006-09-07 15:26 |只看该作者
  1. [root@mail root]# echo pwcheck_method: saslauthd > /usr/lib/sasl2/smtpd.conf

  2. [root@mail root]# echo mech_list: plain login >> /usr/lib/sasl2/smtpd.conf
复制代码

论坛徽章:
0
8 [报告]
发表于 2006-09-07 16:21 |只看该作者
谢谢楼上的兄弟,你那2句话太管用了。不过还有问题,我telnet localhost 25最后认证失败是什么原因啊?过程如下:
#telnet localhost 25
Trying 127.0.0.1...
Connected to www.oswardhead.com (127.0.0.1).
Escape character is '^]'.
220 www.headosward.com ESMTP "Version not Available"
ehlo www.oswardhead.com
250-www.headosward.com
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
auth login
334 VXNlcm5hbWU6
b3N3YXJkaGVhZC8uY29t
334 UGFzc3dvcmQ6
MTIzNDU2
535 Error: authentication failed


错误日志如下:
Sep  7 17:11:08 www postfix/smtpd[1563]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep  7 17:11:09 www postfix/smtpd[1563]: connect from www.oswardhead.com[127.0.0.1]
Sep  7 17:13:23 www postfix/smtpd[1563]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
Sep  7 17:13:23 www postfix/smtpd[1563]: warning: www.oswardhead.com[127.0.0.1]: SASL login authentication failed
这是什么问题?main.cf文件下的SASL我这样配的;
#====================SASL========================
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_invalid_hostname,
  reject_non_fqdn_hostname,
  reject_unknown_sender_domain,
  reject_non_fqdn_sender,
  reject_non_fqdn_recipient,
  reject_unknown_recipient_domain,
  reject_unauth_pipelining,
  reject_unauth_destination,
  permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner=$myhostname ESMTP "Version not Available"
请问这是哪里出的问题啊?

[ 本帖最后由 oswardhead 于 2006-9-7 17:20 编辑 ]

论坛徽章:
0
9 [报告]
发表于 2006-09-07 18:18 |只看该作者
原帖由 oswardhead 于 2006-9-7 14:07 发表
# ./configure \
--disable-anon -enable-plain --enable-login \
--enable-sql --with-mysql=/usr/local/mysql \
--with-mysql-includes=/usr/local/mysql/include/mysql \
--with-mysql-libs=/usr/local/my ...



你配置使用的是
--with-authdaemond

但是别人教你的是
echo pwcheck_method: saslauthd > /usr/lib/sasl2/smtpd.conf
注意这里的认证方式是用saslauthd,你根本没有配置,当然找不到了。

所以你要再仔细看一下相关的文档,修改一下这个smtpd.conf文件。查一下置顶的Postfix文档关于authdaemond的配置吧。

论坛徽章:
0
10 [报告]
发表于 2006-09-08 11:03 |只看该作者
加油,加油,貌似这个问题我也解决了很久!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP