当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 1 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 求教postfix smtp验证失败的解决办法
帖子发表于 : 2009-09-08 11:10 
头像

注册: 2008-11-05 13:24
帖子: 1024
送出感谢: 0 次
接收感谢: 5
按照wiki里的方法,安装了postfix和courier、sasl,mysql
telnet测试110可以通过,客户端验证也没问题,
但是smtp验证就是过不了,一下telnet的结果

希望有人能够赐教。
代码:
link0x@link0x-ubuntu:~$ telnet ××××× 25
Trying ×××××...
Connected to ××××××.
Escape character is '^]'.
220 ××××××× ESMTP Postfix (Ubuntu)
ehlo ×××t.com
250-mail.××××t.com
250-PIPELINING
250-SIZE 15728640
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN
250-AUTH=LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth login
334 VXNlcm5hbWU6
bWFpbEBkaWFuc29mdC5jb20=
334 UGFzc3dvcmQ6
dzEyMzEyMzA=
535 5.7.8 Error: authentication failed: authentication failure


postfix的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 (Ubuntu)
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/apache2/ssl/server.pem
smtpd_tls_key_file=/etc/apache2/ssl/server.pem
smtpd_tls_CAfile = /etc/apache2/ssl/server.pem
smtpd_tls_auth_only = no
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 = ×××××××*.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = ******.com
mydestination =
relayhost =
#mynetworks = all
mynetworks = 127.0.0.0/8
#[::ffff:127.0.0.0]/104 [::1]/128
message_size_limit = 15728640
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

home_mailbox = Maildir/

#virtual mailbox domain settings
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 5000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_transport = virtual

#additional for quota support

virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message =
    Sorry, the your maildir has overdrawn your diskspace quota,
    please free up some of spaces of your mailbox try again.
virtual_overquota_bounce = yes

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = smtpd
#/etc/postfix/sasl:/usr/lib/sasl2
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,permit_auth_destination,reject

改来改去最后的配置时这样的了,/etc/postfix/sasl/smtpd.conf
代码:
pwcheck_method:auxprop
auxprop_plugin:sql
mech_list:PLAN LOGIN
sql_engine:mysql
sql_hostnames:127.0.0.1
sql_user:postfix
sql_password:postfixpassword
sql_select:select password from mailbox where username='%u@%r' and active = 1


/etc/default/saslauthd
代码:
#
# Settings for saslauthd daemon
# Please read /usr/share/doc/sasl2-bin/README.Debian for details.
#

# Should saslauthd run automatically on startup? (default: no)
START=yes

# Description of this saslauthd instance. Recommended.
# (suggestion: SASL Authentication Daemon)
DESC="SASL Authentication Daemon"

# Short name of this saslauthd instance. Strongly recommended.
# (suggestion: saslauthd)
NAME="saslauthd"

# Which authentication mechanisms should saslauthd use? (default: pam)
#
# Available options in this Debian package:
# getpwent  -- use the getpwent() library function
# kerberos5 -- use Kerberos 5
# pam       -- use PAM
# rimap     -- use a remote IMAP server
# shadow    -- use the local shadow password file
# sasldb    -- use the local sasldb database file
# ldap      -- use LDAP (configuration is in /etc/saslauthd.conf)
#
# Only one option may be used at a time. See the saslauthd man page
# for more information.
#
# Example: MECHANISMS="pam"
MECHANISMS="pam"

# Additional options for this mechanism. (default: none)
# See the saslauthd man page for information about mech-specific options.
MECH_OPTIONS=""

# How many saslauthd processes should we run? (default: 5)
# A value of 0 will fork a new process for each connection.
THREADS=5

# Other options (default: -c -m /var/run/saslauthd)
# Note: You MUST specify the -m option or saslauthd won't run!
#
# See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
# See the saslauthd man page for general information about these options.
#
# Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r "


_________________
笔记
-------------------------------------
http://blog.163.com/wqt_1101


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 1 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译