歡迎您光臨本站 註冊首頁

postfix+mysql+sasl 一個很鬱悶的問題

←手機掃碼閱讀     火星人 @ 2014-03-05 , reply:0

postfix+mysql+sasl 一個很鬱悶的問題

系統是: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: sql auxprop plugin using mysql engine
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin Parse the username fengmx@antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin try and connect to a host
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin trying to open db 'postfix' on host 'localhost'
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin Parse the username fengmx@antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin try and connect to a host
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin trying to open db 'postfix' on host 'localhost'
Oct 16 10:52:22 xen-vm1 saslauthd: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module
Oct 16 10:52:22 xen-vm1 saslauthd: do_auth         : auth failure:
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin Parse the username fengmx@antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin try and connect to a host
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin trying to open db 'postfix' on host 'localhost'
Oct 16 10:52:22 xen-vm1 postfix/smtpd: begin transaction
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin create statement from userPassword fengmx antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin doing query SELECT password FROM mailbox WHERE username = 'fengmx@antivs.com' ;
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin create statement from cmusaslsecretPLAIN fengmx antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin doing query SELECT password FROM mailbox WHERE username = 'fengmx@antivs.com' ;
Oct 16 10:52:22 xen-vm1 postfix/smtpd: commit transaction
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin Parse the username fengmx@antivs.com
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin try and connect to a host
Oct 16 10:52:22 xen-vm1 postfix/smtpd: sql plugin trying to open db 'postfix' on host 'localhost'
Oct 16 10:57:37 xen-vm1 postfix/smtpd: sql auxprop plugin using mysql engine


tail -f /var/log/messages:
Oct 16 10:52:21 xen-vm1 postfix/smtpd: connect from unknown
Oct 16 10:52:22 xen-vm1 postfix/smtpd: warning: unknown: SASL LOGIN authentication failed
Oct 16 10:52:22 xen-vm1 postfix/smtpd: lost connection after AUTH from unknown
Oct 16 10:52:22 xen-vm1 postfix/smtpd: disconnect from unknown
Oct 16 10:55:42 xen-vm1 postfix/anvil: 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: 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: statistics: max cache size 1 at Oct 16 10:52:21
Oct 16 10:57:37 xen-vm1 postfix/smtpd: warning: 202.181.134.25: address not listed for hostname donut.udomain.com.hk
Oct 16 10:57:37 xen-vm1 postfix/smtpd: connect from unknown
Oct 16 10:57:38 xen-vm1 postfix/smtpd: NOQUEUE: reject: RCPT from unknown: 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: disconnect from unknown
Oct 16 11:00:58 xen-vm1 postfix/anvil: 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: 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: statistics: max cache size 1 at Oct 16 10:57:37


  我是使用客戶端的outlook來接收和發送郵件,接收郵件很正常,可是就是在客戶端是用outlook發送郵件時,總是發不出去。
  在用戶進行sasl認證時, 我是想使用資料庫postfix來進行用戶的認證,可smtp好象打不開資料庫,不知道為什麼?煩請各位高手指點一下,小妹已經鬱悶了兩個星期了!!!



:shock:
《解決方案》

或者你可以使用Courier-authlib
pwcheck_method: authdaemond
我看很多文檔都是用這個的
《解決方案》

先試試樓上說的結合一下Courier-authlib后
修改
pwcheck_method:authdaemond

[火星人 ] postfix+mysql+sasl 一個很鬱悶的問題已經有532次圍觀

http://coctec.com/docs/service/show-post-45100.html