LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 816|回复: 1

[求助]无法通过postfix的验证

[复制链接]
发表于 2006-5-7 23:40:44 | 显示全部楼层 |阅读模式
debian sarge

安装了 postfix (sasl)+ courier-IMAP (带 smtp 认证)。
apt-get install postfix postfix-tls libsasl2 sasl2-bin libsasl2-modules ipopd-ssl uw-imapd-ssl

postconf -e 'smtpd_sasl_local_domain ='
postconf -e 'smtpd_sasl_auth_enable = yes'
postconf -e 'smtpd_sasl_security_options = noanonymous'
postconf -e 'broken_sasl_auth_clients = yes'
postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_
destination'
postconf -e 'inet_interfaces = all'
echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf
echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf

mkdir /etc/postfix/ssl
cd /etc/postfix/ssl/
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024
chmod 600 smtpd.key
openssl req -new -key smtpd.key -out smtpd.csr
openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt
openssl rsa -in smtpd.key -out smtpd.key.unencrypted
mv -f smtpd.key.unencrypted smtpd.key
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650

postconf -e 'smtpd_tls_auth_only = no'
postconf -e 'smtp_use_tls = yes'
postconf -e 'smtpd_use_tls = yes'
postconf -e 'smtp_tls_note_starttls_offer = yes'
postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'
postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'
postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'
postconf -e 'smtpd_tls_loglevel = 1'
postconf -e 'smtpd_tls_received_header = yes'
postconf -e 'smtpd_tls_session_cache_timeout = 3600s'
postconf -e 'tls_random_source = dev:/dev/urandom'
重启postfix
/etc/init.d/postfix restart

mkdir -p /var/spool/postfix/var/run/saslauthd
rm -fr /var/run/saslauthd
编辑/etc/default/saslauthd,移除START=yes的#,并增加一行:
START=yes
PARAMS="-m /var/spool/postfix/var/run/saslauthd -r"

编辑 /etc/init.d/saslauthd,将这一行dir=`dpkg-statoverride --list $PWDIR`注释掉:
#dir=`dpkg-statoverride --list $PWDIR`
在文件的开头,改变变量PWDIR和PIDFILE,增加变量dir:
PWDIR="/var/spool/postfix/var/run/${NAME}"
PIDFILE="${PWDIR}/saslauthd.pid"
dir="root sasl 755 ${PWDIR}"

重新启动saslauthd
/etc/init.d/saslauthd start

安装 Courier-IMAP/Courier-POP3
apt-get install courier-imap courier-imap-ssl courier-pop courier-pop-ssl

postconf -e 'home_mailbox = Maildir/'
postconf -e 'mailbox_command ='
/etc/init.d/postfix restart

Perl –MMIME::Base64 –e 'print encode_base64("username\0username\0password"); '
telnet localhost 25
ehlo localhost
能看到 250-STARTTLS 和 250-AUTH LOGIN PLAIN 字样。
auth plain xxxxxx
用系统用户能正常登陆。

输入 STARTTLS 显示 220 Ready to start TLS.(正常)

出现的问题:

输入 postfix check 无任何输出,这个正常吗?

telnet localhost 110
ehlo localhost
USER username@example.com
PASS password
无法通过验证。


mail username@example.com < /etc/hostname
/var/mail目录下没有自动生成 example.com 这样的文件夹。


courierauthtest test username
courierauthtest test username@example.com username
都无法通过验证。

请问:在哪里查看出错的日志?我还需要提供哪些信息,才能判断问题出在哪里?
 楼主| 发表于 2006-5-11 12:36:28 | 显示全部楼层
顶起来,希望有人能指点一下,先谢了~~~~~~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表