免费注册 查看新帖 |

Chinaunix

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

postfix+sasl邮件中,smtpd server使用mysql认证 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-10-16 11:13 |只看该作者 |倒序浏览
系统是:SuSE10.1
安装的数据包:
postfix-2.2.9-10
postfix-mysql-2.2.9-10
dovecot-1.0.beta3-13
cyrus-sasl-2.1.21-18
cyrus-sasl-saslauthd-2.1.21-18
cyrus-sasl-digestmd5-2.1.21-18
cyrus-sasl-plain-2.1.21-18
cyrus-sasl-devel-2.1.21-18
cyrus-sasl-crammd5-2.1.21-18
cyrus-sasl-sqlauxprop-2.1.21-18
cyrus-sasl-gssapi-2.1.21-18
配置文件是:
/etc/postfix/main.cf
readme_directory = /usr/share/doc/packages/postfix/README_FILES
inet_protocols = all
biff = no
mail_spool_directory = /var/mail
canonical_maps = hash:/etc/postfix/canonical
virtual_mailbox_maps = mysql:/etc/postfix/vmaps-mysql.cf
virtual_mailbox_domains = /etc/postfix/vhosts
#virtual_alias_maps = hash:/etc/postfix/virtual
#virtual_alias_domains = hash:/etc/postfix/virtual
relocated_maps = hash:/etc/postfix/relocated
transport_maps = hash:/etc/postfix/transport
sender_canonical_maps = hash:/etc/postfix/sender_canonical
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
myhostname = xen-vm1.hasux.com
program_directory = /usr/lib/postfix
inet_interfaces = 202.82.144.90 192.168.27.3
masquerade_domains =
mydestination = $myhostname, localhost.$mydomain
relay_domains =
defer_transports =
mynetworks_style = subnet
disable_dns_lookups = no
relayhost =
mailbox_command =
mailbox_transport =
strict_8bitmime = no
disable_mime_output_conversion = no
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_helo_required = no
smtpd_helo_restrictions =
strict_rfc821_envelopes = no
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,rejec
t_unauth_destination
smtp_sasl_auth_enable = no
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_use_tls = no
smtp_use_tls = no
alias_maps = hash:/etc/aliases
mailbox_size_limit = 1024000000
message_size_limit = 1024000000
mydomain = antivs.com
virtual_mailbox_base = /var/spool/vmail
virtual_mailbox_limit = 1024000000
virtual_uid_maps = static:1000
virtual_gid_maps = static:1000
smtpd_sasl_application_name = smtpd



/usr/lib/sasl2/smtp.conf
pwcheck_method: auxprop
auxprop_plugin: sql
mech_list: plain login cram-md5 digest-md5
sql_engine: mysql
sql_hostnames: localhost
sql_database: postfix
sql_user: postfix
sql_passwd: postfix
sql_select: SELECT password FROM mailbox WHERE username = '%u@%r'
log_level: 7
sql_verbose: yes

系统的log:

tail -f /var/log/mail
Oct 16 10:52:21 xen-vm1 postfix/smtpd[6507]: sql auxprop plugin using mysql engine
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin Parse the username fengmx@antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin try and connect to a host
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin trying to open db 'postfix' on host 'localhost'
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin Parse the username fengmx@antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin try and connect to a host
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin trying to open db 'postfix' on host 'localhost'
Oct 16 10:52:22 xen-vm1 saslauthd[6503]: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module
Oct 16 10:52:22 xen-vm1 saslauthd[6503]: do_auth         : auth failure: [user=fengmx] [service=smtp] [realm=antivs.com] [mech=pam] [reason=PAM auth error]
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin Parse the username fengmx@antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin try and connect to a host
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin trying to open db 'postfix' on host 'localhost'
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: begin transaction
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin create statement from userPassword fengmx antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin doing query SELECT password FROM mailbox WHERE username = 'fengmx@antivs.com' ;
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin create statement from cmusaslsecretPLAIN fengmx antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin doing query SELECT password FROM mailbox WHERE username = 'fengmx@antivs.com' ;
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: commit transaction
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin Parse the username fengmx@antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin try and connect to a host
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: sql plugin trying to open db 'postfix' on host 'localhost'
Oct 16 10:57:37 xen-vm1 postfix/smtpd[6520]: sql auxprop plugin using mysql engine


tail -f /var/log/messages:
Oct 16 10:52:21 xen-vm1 postfix/smtpd[6507]: connect from unknown[218.16.44.195]
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: warning: unknown[218.16.44.195]: SASL LOGIN authentication failed
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: lost connection after AUTH from unknown[218.16.44.195]
Oct 16 10:52:22 xen-vm1 postfix/smtpd[6507]: disconnect from unknown[218.16.44.195]
Oct 16 10:55:42 xen-vm1 postfix/anvil[6509]: statistics: max connection rate 1/60s for (smtp:218.16.44.195) at Oct 16 10:52:21
Oct 16 10:55:42 xen-vm1 postfix/anvil[6509]: statistics: max connection count 1 for (smtp:218.16.44.195) at Oct 16 10:52:21
Oct 16 10:55:42 xen-vm1 postfix/anvil[6509]: statistics: max cache size 1 at Oct 16 10:52:21
Oct 16 10:57:37 xen-vm1 postfix/smtpd[6520]: warning: 202.181.134.25: address not listed for hostname donut.udomain.com.hk
Oct 16 10:57:37 xen-vm1 postfix/smtpd[6520]: connect from unknown[202.181.134.25]
Oct 16 10:57:38 xen-vm1 postfix/smtpd[6520]: NOQUEUE: reject: RCPT from unknown[202.181.134.25]: 554 <tun@antivs.com>: Relay access denied; from=<cowpoxbait@royaltyband.com> to=<tun@antivs.com> proto=SMTP helo=<donut.udomain.com.hk>
Oct 16 10:57:38 xen-vm1 postfix/smtpd[6520]: disconnect from unknown[202.181.134.25]
Oct 16 11:00:58 xen-vm1 postfix/anvil[6522]: statistics: max connection rate 1/60s for (smtp:202.181.134.25) at Oct 16 10:57:37
Oct 16 11:00:58 xen-vm1 postfix/anvil[6522]: statistics: max connection count 1 for (smtp:202.181.134.25) at Oct 16 10:57:37
Oct 16 11:00:58 xen-vm1 postfix/anvil[6522]: statistics: max cache size 1 at Oct 16 10:57:37


  我是使用客户端的outlook来接收和发送邮件,接收邮件很正常,可是就是在客户端是用outlook发送邮件时,总是发不出去。
  在用户进行sasl认证时, 我是想使用数据库postfix来进行用户的认证,可smtp好象打不开数据库,不知道为什么?烦请各位高手指点一下,小妹已经郁闷了两个星期了!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP