歡迎您光臨本站 註冊首頁

求助postfix+dovecot+mysql+extmail問題(貼出所有日誌和配置文件)

搭建的是LAMP的環境

問題(一)
編譯的安裝的postfix和dovecot
main.cf 的配置文件
# egrep -v  '^#|^$'   /etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = all
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
home_mailbox = Maildir/


debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = no

manpage_directory = /usr/local/man
sample_directory = /etc/postfix
readme_directory = no
smtpd_sasl_type = dovecot
smtpd_sasl_path = /usr/local/var/run/dovecot/auth-client
smtpd_sasl_authenticated_header = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
mynetworks = 127.0.0.1
smtp_sasl_password_maps = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
smtpd_recipient_restrictions=permit_mynetworks,permit_sas1_authenticated,reject_unauth_destination
smtpd_sender_restrictions =
        permit_mynetworks,
        reject_sender_login_mismatch,
        reject_authenticated_sender_login_mismatch,
        reject_unauthenticated_sender_login_mismatch
virtual_mailbox_base = /mailbox
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_uid_maps = static:502
virtual_gid_maps = static:502
___________________________________________________
dovecot.conf配置文件
ssl = no
default_login_user = dovecot
disable_plaintext_auth = no
passdb sql {
      driver = sql
        args = /etc/dovecot/dovecot/dovecot-mysql.conf
    }
userdb sql {
      driver = sql
       args = /etc/dovecot/dovecot/dovecot-mysql.conf
    }

————————————————————————————————————
錯誤出現
# telnet localhost 110
Trying 127.0.0.1...
Connected to mail.123.com (127.0.0.1).
Escape character is '^]'.
+OK Dovecot ready.
user user1
+OK
pass user1
-ERR Temporary authentication failure.
quit
+OK Logging out
Connection closed by foreign host.
——————————————————————————————————————————————————————————————
查看日誌 vim /var/log/maillog

Mar 15 16:35:08 mail dovecot: auth: mysql(/tmp/mysql.sock): Connected to database extmail
Mar 15 16:35:08 mail dovecot: auth: Error: mysql: Query failed, retrying: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'user1'' at line 1
Mar 15 16:35:08 mail dovecot: auth: Error: sql(user1,127.0.0.1): Password query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'user1'' at line 1
Mar 15 16:35:13 mail dovecot: pop3-login: Aborted login (auth failed, 1 attempts): user=<user1>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
說我的查詢語句有問題
——————————————————————————————————————————————————————————————
貼出我的查詢語句
driver = mysql
connect = host=/tmp/mysql.sock  dbname=extmail user=extmail password=extmail
default_pass_scheme = MD5
password_query = SELECT username AS user,password AS password FROM mailbox WHEREusername = '%u'
user_query = SELECT maildir, uidnumber AS uid, gidnumber AS gid FROM mailbox WHERE username = '%u'
不知道問題出在哪裡(求解)
——————————————————————————————————————————————————————————————
問題(二)
把apache mysql postfix dovecot 全部啟動起來,全部沒有報錯
我用的extmail
使用web收發信可以,但是使用foxmail就是不可以的
貼出錯誤日誌
使用foxmail報錯日誌

Mar 15 16:41:54 mail postfix/smtpd: connect from unknown
Mar 15 16:41:56 mail postfix/smtpd: warning: unknown: SASL PLAIN authentication failed:
Mar 15 16:41:56 mail postfix/smtpd: lost connection after AUTH from unknown
Mar 15 16:41:56 mail postfix/smtpd: disconnect from unknown
Mar 15 16:42:03 mail postfix/smtpd: connect from unknown
Mar 15 16:42:07 mail dovecot: auth: mysql(/tmp/mysql.sock): Connected to database extmail
Mar 15 16:42:07 mail dovecot: auth: Error: mysql: Query failed, retrying: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'user1'' at line 1
Mar 15 16:42:07 mail dovecot: auth: Error: sql(user1,192.168.1.69): Password query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'user1'' at line 1
Mar 15 16:42:09 mail postfix/smtpd: warning: unknown: SASL PLAIN authentication failed:
Mar 15 16:42:09 mail postfix/smtpd: lost connection after AUTH from unknown
Mar 15 16:42:09 mail postfix/smtpd: disconnect from unknown
Mar 15 16:42:09 mail dovecot: pop3-login: Disconnected (auth failed, 1 attempts): user=<user1>, method=PLAIN, rip=192.168.1.69, lip=192.168.1.219
————————————————————————————————————————————————————————————————————————————————
補充
我是參考這位作者做出來的,
http://www.shifangyue.com/a/wangluowenzhai/LAMP/2010/1009/41.html

估計還是dovecot的錯誤
但是不知道為什麼smtpd也出現錯誤,驗證不了用戶,我是在extmail網頁見面建立的user1和密碼user1
為什麼通不過認證呢?
為什麼用網頁打開就能正常的收發?

謝謝大家了,我把所有的都貼出來了,請大家指點小弟。
《解決方案》

????沒喲人?

[火星人 ] 求助postfix+dovecot+mysql+extmail問題(貼出所有日誌和配置文件)已經有1009次圍觀

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