peijun.jiang 回復于:2003-08-25 09:33:03 |
不錯,支持原創。 |
jsf008 回復于:2003-08-25 11:50:21 |
偶正研究這個。。。中。。。 |
mb 回復于:2003-08-25 16:20:38 |
補一下
crypt字段必須是使用crypt()函數加密過的密碼,在mysql中,用encrt'''s''')就可以直接生成加密過的密碼。 |
jsf008 回復于:2003-08-25 16:49:29 |
我用的就是courier-imap
我測試時總是這樣: [root@mail etc]# telnet 127.0.0.1 110 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is&np''^'''. +OK Hello there. user jshf@liuzt.wst +OK Password required. pass 123456 -ERR Login failed. |
mb 回復于:2003-08-25 16:51:42 |
看看你的authmysqlrc配置
建議在調試時打開mysql.log 看看數據庫查詢情況 |
jsf008 回復于:2003-08-25 17:05:47 |
root@test /etc/courier-imap# vi authmysqlrc
MYSQL_SERVER localhost MYSQL_USERNAME courier MYSQL_PASSWORD whatever MYSQL_SOCKET /var/run/mysql/mysql.sock MYSQL_PORT 3306 MYSQL_OPT &nbnbsp; 0 MYSQL_DATABASE &n; maildb MYSQL_USER_TABLE users MYSQL_CRYPT_PWFIELD crypt MYSQL_CLEAR_PWFIELD clear DEFAULT_DOMAIN liuzt.wst MYSQL_UID_FIELD uid MYSQL_GID_FIELD gid MYSQL_LOGIN_FIELD id MYSQL_HOME_FIELD home MYSQL_NAME_FIELD name MYSQL_MAILDIR_FIELD maildir mysql.log我不知怎樣打開, |
garfy 回復于:2003-08-25 17:08:23 |
mail版越來越豐富了! |
mb 回復于:2003-08-26 08:27:28 |
1.看看你的MYSQL_SOCKET 路徑是不是正確
2.修改my.cnf 打開mysql.log 并在里面有mysql.sock的路徑 3.根據telnet 127.0.0.1 110進行認證時看看mysql.log中的查迅情況 |
jsf008 回復于:2003-08-26 08:30:44 |
[quote:abe45826e2="mb"]
建議在調試時打開mysql.log 看看數據庫查詢情況[/quote:abe45826e2] 樓主,怎樣才能打開mysql.log 偶的可能不行。 |
mb 回復于:2003-08-26 08:37:45 |
在 [mysqld]下添加
如下 log=/mail/log/mysql.log 再改mysql.log為mysql所有 chown mysql:mysql /mail/log/mysql.log service syslog restart 再試試 |
jsf008 回復于:2003-08-26 08:42:33 |
這就是my.cnf了,mysql.log怎么加呢
# The MySQL server [mysqld] port = 3306 socket = /var/run/mysql/mysql.sock skip-networking [mysqldump] [mysql] [isamchk] [myisamchk] [mysqlhotcopy] |
jsf008 回復于:2003-08-26 09:02:52 |
root@test /var/log# telnet 127.0.0.1 110
Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is&np''^'''. +OK Hello there. user tom@jshf.wst +OK Password required. pass whatever -ERR Login failed. 還是登陸不了 /usr/sbin/mysqld, Version: 4.0.13-log, started with: Tcp port: 0 Unix socket: /var/run/mysql/mysql.sock Time Id Command Argument 030826 9:00:27 1 Connect courier@localhost on 1 Init DB maildb 1 Query SELECT id, crypt, clear, uid, gid, home, maildir, "", name FROM users WHERE id = "tom@jshf.wst" AND (impok=1 AND bool1=1 AND bool2=1) 1 Quit 2 Connect courier@localhost on 2 Init DB maildb 2 Query SELECT id, crypt, clear, uid, gid, home, maildir, "", name FROM users WHERE id = "tom@jshf.wst" AND (impok=1 AND bool1=1 AND bool2=1) |
mb 回復于:2003-08-26 10:00:02 |
030826 9:00:27 1 Connect courier@localhost on
數據據連接成功 得到了您的用戶查詢,但好像還是加密后的密碼不正確 在你的authmysqlrc中 MYSQL_CRYPT_PWFIELD cryptp之間是一個tab鍵的距離,以前在doc中看到過說哪里的距離不是空格 |
jsf008 回復于:2003-08-26 11:28:05 |
1 Query SELECT id, crypt, clear, uid, gid, home, maildir, [color=red:4f9ba322e1]""[/color:4f9ba322e1], name FROM users WHERE id = "tom@jshf.wst" AND (impok=1 AND bool1=1 AND bool2=1)
查詢語句為什么會出現紅色的那個雙引號呢, |
mb 回復于:2003-08-26 11:35:41 |
和哪個沒關系吧
哪是因為在authmysqlrc中有被你注釋的項,哪是空的,沒有不正常 的呀 把quota前的#去了再看 |
jsf008 回復于:2003-08-26 11:43:23 |
我的authmysqlrc中沒有quota 這項? |
jsf008 回復于:2003-08-26 12:09:03 |
真是暈死了~~~還是不行,
看看authdaemonrc有錯沒有? authmodulelist="authmysql authpam" authmoudlelistorig="authmysql authpam" daemons=5 version="authdaemond.mysql" authdaemonvar=/var/spool/authdaemon/courier-imap |
mb 回復于:2003-08-26 12:59:59 |
version="authdaemond.mysql"
可以不設的,我的不設,設為空的,不過,哪不像主要原因,現在的密碼認證不對,在安裝源文件中cp -a 過來一個authmysqlrc吧,再改一下,可能是crypt哪里多了空格了 |
jsf008 回復于:2003-08-26 14:23:56 |
這是我新copy過來地一個:怎么測試還通不過呢
##VERSION: $Id: authmysqlrc,v 1.10 2002/04/02 23:41:41 mrsam Exp $ # # Copyright 2000 Double Precision, Inc. See COPYING for # distribution information. # # Do not alter lines that begin with ##, they are used when upgrading # this configuration. # # authmysqlrc created from authmysqlrc.dist by sysconftool # # DO NOT INSTALL THIS FILE with world read permissions. This file # might contain the MySQL admin password! # # Each line in this file must follow the following format: # # field[spaces|tabs]value # # That is, the name of the field, followed by spaces or tabs, followed by # field value. Trailing spaces are prohibited. ##NAME: LOCATION:0 # # The server name, userid, and password used to log in. MYSQL_SERVER localhost MYSQL_USERNAME courier MYSQL_PASSWORD whatever ##NAME: MYSQL_SOCKET:0 # # MYSQL_SOCKET can be used with MySQL version 3.22 or later, it specifies the # filesystem pipe used for the connection # # MYSQL_SOCKET /var/run/mysql/mysql.sock ##NAME: MYSQL_PORT:0 # # MYSQL_PORT can be used with MySQL version 3.22 or later to specify a port to # connect to. MYSQL_PORT 0 ##NAME: MYSQL_OPT:0 # # Leave MYSQL_OPT as 0, unless you know what o'''re doing. MYSQL_OPT 0 ##NAME: MYSQL_DATABASE:0 # # The name of the MySQL database we will open: MYSQL_DATABASE maildb ##NAME: MYSQL_USER_TABLE:0 # # The name of the table containing your user data. See README.authmysqlrc # for the required fields in this table. MYSQL_USER_TABLE users ##NAME: MYSQL_CRYPT_PWFIELD:0 # # Either MYSQL_CRYPT_PWFIELD or MYSQL_CLEAR_PWFIELD must be defined. Both # are OK too. crypted passwords go into MYSQL_CRYPT_PWFIELD, cleartext # passwords go into MYSQL_CLEAR_PWFIELD. Cleartext passwords allow # CRAM-MD5 authentication to be implemented. MYSQL_CRYPT_PWFIELD crypt ##NAME: MYSQL_CLEAR_PWFIELD:0 # # # MYSQL_CLEAR_PWFIELD clear ##NAME: MYSQL_DEFAULT_DOMAIN:0 # # If DEFAULT_DOMAIN is defined, and someone tries to log in as&np'''e''', # we will look up&np'''user@DEFAULT_DOI''' instead. # # # DEFAULT_DOMAIN example.com ##NAME: MYSQL_UID_FIELD:0 # # Other fields in the mysql table: # # MYSQL_UID_FIELD - contains the numerical userid of the account # MYSQL_UID_FIELD uid ##NAME: MYSQL_GID_FIELD:0 # # Numerical groupid of the account MYSQL_GID_FIELD gid ##NAME: MYSQL_LOGIN_FIELD:0 # # The login id, default is id. Basically the query is: # # SELECT MYSQL_UID_FIELD, MYSQL_GID_FIELD, ... WHERE d'''logi''' # MYSQL_LOGIN_FIELD id ##NAME: MYSQL_HOME_FIELD:0 # MYSQL_HOME_FIELD home ##NAME: MYSQL_NAME_FIELD:0 # # The e'''s name (optional) MYSQL_NAME_FIELD name ##NAME: MYSQL_MAILDIR_FIELD:0 # # This is an optional field, and can be used to specify an arbitrary # location of the maildir for the account, which normally defaults to # $HOME/Maildir (where $HOME is read from MYSQL_HOME_FIELD). # # You still need to provide a MYSQL_HOME_FIELD, even if you uncomment this # out. # # MYSQL_MAILDIR_FIELD maildir ##NAME: MYSQL_QUOTA_FIELD:0 # # Define MYSQL_QUOTA_FIELD to be the name of the field that can optionally # specify a maildir quota. See README.maildirquota for more information # # MYSQL_QUOTA_FIELD quota ##NAME: MYSQL_WHERE_CLAUSE:0 # # This is optional, MYSQL_WHERE_CLAUSE can be basically set to an arbitrary # fixed string that is appended to the WHERE clause of our query # # #MYSQL_WHERE_CLAUSE serr'''mailhost.exampleo''' ##NAME: MYSQL_SELECT_CLAUSE:0 # # (EXPERIMENTAL) # This is optional, MYSQL_SELECT_CLAUSE can be set when you have a database, # which is structuraly different from proposed. The fixed string will # be used to do a SELECT operation on database, which should return fields # in order specified bellow: # # username, cryptpw, uid, gid, clearpw, home, maildir, quota, fullname # # Enabling this option causes ignorance of any other field-related # options, excluding default domain. # # There are two variables, which you can use. Substitution will be made # for them, so you can put entered username (local part) and domain name # in the right place of your query. These variables are: # $(local_part) and $(domain) # # If a $(domain) is empty (not given by the remote user) the default domain # name is used in its place. # # This example is a little bit modified adaptation of vmail-sql # database scheme: # # MYSQL_SELECT_CLAUSE SELECT popbox.local_part, \ # COA('''D}''', popbox.password_hash), \ # popbox.clearpw, \ # domain.uid, \ # domain.gid, \ # CONCAT(domain.pt&s;''/'''', popbox.mbox_name), \ # &b&bp''''''', \ # domain.quota, \ #  &p&bp''''''', \ # FROM popbox, domain \ # WHERE popbox.local_parns; ''''(oa_part)'''' \ # AND popbox.domain_nmns;=&nbp;'''$domain)'''' \ # AND popbox.domain_name = domain.domain_name # ##NAME: MYSQL_CHPASS_CLAUSE:0 # # (EXPERIMENTAL) # This is optional, MYSQL_CHPASS_CLAUSE can be set when you have a database, # which is structuraly different from proposed. The fixed string will # be used to do an UPDATE operation on database. In other words, it is # used, when changing password. # # There are four variables, which you can use. Substitution will be made # for them, so you can put entered username (local part) and domain name # in the right place of your query. There variables are: # $(local_part) , $(domain) , $(newpass) , $(newpass_crypt) # # If a $(domain) is empty (not given by the remote user) the default domain # name is used in its place. # $(newpass) contains plain password # $(newpass_crypt) contains its crypted form # # MYSQL_CHPASS_CLAUSE UPDATE popbox \ # SET &ns&bp;cleapw='''(newpass)'''', \ # &nppassword_hash=''$nwass_crypt)'''' \ # WHERE &nbpns;local_pat='''$local_part)'''' \ # AND &nbpns;doman_nam='''$(domain)'''' # |
mb 回復于:2003-08-27 08:20:56 |
MYSQL_PORT 0 ????應是3306吧
其實你的mysql在本機可以不用指定,在前面加上#吧 |
jsf008 回復于:2003-08-27 08:44:55 |
還是不行哪,毛病還是那樣,還能哪兒出錯呢 |
jsf008 回復于:2003-08-29 15:49:11 |
mb兄臺,多謝你的全力幫助,那個問題總算搞定了,就是version="authdaemond.mysql" 前面加個#,在輸入用戶名用的是test,而不是test@liuzt.wst,這樣就行了,能通過驗證了,
又一個問題出現了,能過驗證后,郵件收不來,? |
mb 回復于:2003-08-30 08:53:55 |
呵呵,恭喜,成功一半了
telnet 127.0.0.1 110 后有什么結果 mail xxx@domain.com 后看看maillog怎樣 |
jsf008 回復于:2003-08-30 09:49:33 |
root@test /home/users/jshf# telnet 127.0.0.1 110
Trying 127.0.0.1... Connected to 127.0.0.1. Escape chrt&bspi&bp;''''^]''''. +OK Hello there. user jshf +OK Password required. pass 123456 +OK logged in. quit +OK Bye-bye. $ mail jshf@liuzt.wst后,mysql.log是這樣 /usr/sbin/mysqld, Version: 4.0.13-log, started with: Tcp port: 0 Unix socket: /var/run/mysql/mysql.sock Time Id Command Argument 030830 9:48:25 1 Connect courier@localhost on maildb 1 Query select transport from transport where&nbs;mnnbp=nsp;''''*'''' 2 Connect courier@localhost on maildb 2 Query select goto from virtual where ars =&nbp;'''jhf@liuzt.wst'''' 2 Query select goto from virtual where arsnbsp;&bp''''jshf'''' 2 Query select goto from virtual where ars  '''@liuzt.wst'''' 3 Connect courier@localhost on maildb 3 Query select goto from virtual where ars =&nbs;'''liuzt.wst'''' 4 Connect courier@localhost on maildb 4 Query select maildir from users where ars =&nbs;'''liuzt.wst'''' 1 Query select transport from transport where&nbs;mi =&nbp;'''jhf@liuzt.wst'''' 1 Query select transport from transport where&nbs;mi =&nbs;'''liuzt.wst'''' 5 Connect courier@localhost on maildb 5 Query select maildir from users where ars =&nbp;'''jhf@liuzt.wst'''' 6 Connect courier@localhost on maildb 6 Query select uid from users where ars =&nbp;'''jhf@liuzt.wst'''' 7 Connect courier@localhost on maildb 7 Query select gid from users where ars =&nbp;'''jhf@liuzt.wst'''' maillog是這樣 Aug 30 09:48:25 test postfix/pickup[725]: 3181D104204: uid=0 from=<root> Aug 30 09:48:25 test postfix/cleanup[757]: 3181D104204: message-id=<20030830134825.3181D104204@mail.liuzt.wst> Aug 30 09:48:25 test postfix/qmgr[726]: 3181D104204: from=<root@liuzt.wst>, size=285, nrcpt=1 (queue active) Aug 30 09:48:25 test postfix/virtual[763]: 3181D104204: to=<jshf@liuzt.wst>, relay=virtual, delay=0, status=sent (maildir) 象上面在linux系統上操作都可以的,可是用foxmai,outlook時就不行了,有無密碼都行,用tom@liuzt.wst向jshf@liuzt.wst發信,用foxmail收不到。 |
seacaptain 回復于:2003-08-30 15:56:03 |
請教個問題。在使用mysql存儲用戶信息的情況下。qmail是通過什么方式查找用戶的信息呢。比如該用戶是不是存在。qmail也要到mysql中查找嗎 |
jsf008 回復于:2003-08-30 16:54:20 |
用outlook收信時,又出現這樣的錯誤
未檢索到編號為 1 的郵件。 帳戶ns;92.168.0.129'''', 服務器ns;92.168.0.129'''', 協議: PO3ns;服務器響應:&nsp;'''ERR Can''''t open the message&nbs;l&bsp;-&nbp;it''s gone!'''', 端口: 110, 安全(SSL): 否, 服務器錯誤: 0x800CCC90, 錯誤號: 0x800420CD 最后發現原因是這樣: 偶發現偶收到的信(在/home/users/jshf/Maildir/cur下面)具有這樣屬性 -rw------- 1 1000 1000 3839 Aug 31 07:42 1062330172.V900Id40a5.test 如果把它chmod 777 就可用outlook,foxmail收到,我該怎么使它一到郵箱就已是777或775了呢 |
jsf008 回復于:2003-09-01 10:19:06 |
MB兄,你遇到過上面這樣問題嗎 |
jsf008 回復于:2003-09-01 10:34:51 |
[quote:643edf2dd4="seacaptain"]。比如該用戶是不是存在。qmail也要到mysql中查找嗎[/quote:643edf2dd4]
應該是吧,這里有好多qmail相關地,你看看 |
wxy 回復于:2003-09-0:2003-09-01 10:38:17 |
我最近剛剛搞完了courier-imap + mysql + postfix + sasl的配置~~
我沒有用courier里面SMTPD,還是用的Postfix~~ 過一段時間把它寫間把它寫出來~~ |
mb 回復于:2003-09-01 10:51:17 |
呵呵,我忘了在我的安裝說明筆記中說了,哪個gid uid要用你的web服務身份所用的權限來建立 |
jsf008 回復于:2003-09-01 14:28:19 |
“哪個gid uid要用你的web服務身份所用的權限來建立”我不太明白
這個是在哪步進行地呢 |
firer2000 回復于:2003-09-01 16:55:59 |
g |