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 |