View previous topic :: View next topic |
Author |
Message |
magicfrank n00b
Joined: 02 Oct 2003 Posts: 58 Location: Quebec
|
Posted: Tue Feb 15, 2005 1:35 am Post subject: Imap and Mysql authentification |
|
|
Hi all,
It's been 2 days now and still I don't understand what'going on. Postfix works perfect with mysql but courrier-imap refuse to authentificate my users. I posted below somes of my configuration files in case of someone finds my problem.
authdaemonrc:
#authmodulelist="authcustom authcram authuserdb authldap authpgsql authmysql authpwd"
authmodulelist="authmysql authpam"
authmodulelistorig="authcustom authcram authuserdb authldap authpgsql authmysql authpwd"
daemons=5
version=""
authdaemonvar=/var/run/courier-imap
authmysql:
MYSQL_SERVER 127.0.0.1
MYSQL_USERNAME user
MYSQL_PASSWORD pass
MYSQL_SOCKET /var/run/mysql/mysql.sock
#MYSQL_PORT 0
MYSQL_OPT 0
MYSQL_DATABASE maildb
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD crypt
MYSQL_UID_FIELD '1000'
MYSQL_GID_FIELD '1000'
MYSQL_LOGIN_FIELD id
MYSQL_HOME_FIELD home
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD CONCAT(home,'/',maildir)
description of mysql table:
+-----------------+----------------------+------+-----+----------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+----------------------+------+-----+----------------+-------+
| id | varchar(128) | | PRI | | |
| crypt | varchar(128) | | | | |
| name | varchar(128) | | | | |
| uid | smallint(5) unsigned | | | 507 | |
| gid | smallint(5) unsigned | | | 507 | |
| home | varchar(255) | | | /home/virtual/ | |
| maildir | varchar(255) | | | | |
| quota | varchar(255) | | | | |
| enabled | tinyint(3) unsigned | | | 1 | |
| change_password | tinyint(3) unsigned | | | 1 | |
| procmailrc | varchar(128) | | | | |
| spamassassinrc | varchar(128) | | | | |
+-----------------+----------------------+------+-----+----------------+-------+
here is the log file:
Feb 14 19:40:08 mail imapd: LOGIN: DEBUG: ip=[::ffff:192.168.0.48], command=CAPABILITY
Feb 14 19:40:08 mail imapd: LOGIN: DEBUG: ip=[::ffff:192.168.0.48], command=LOGIN
Feb 14 19:40:08 mail imapd: LOGIN: DEBUG: ip=[::ffff:192.168.0.48], username=user
Feb 14 19:40:08 mail imapd: LOGIN: DEBUG: ip=[::ffff:192.168.0.48], password=pass
If anyone has an idea, please let me know.
Frank |
|
Back to top |
|
|
langthang Retired Dev
Joined: 27 Nov 2003 Posts: 620
|
Posted: Tue Feb 15, 2005 2:31 am Post subject: |
|
|
courier-imap verison? Upgrade or fresh install?
post the output of `grep -Ev '^$|^#' /etc/courier-imap/imapd`
try with authmodulelist="authmysql" , you don't need both.
your users table doesn't have a value in "maildir". _________________ Gentoo users' map |
|
Back to top |
|
|
magicfrank n00b
Joined: 02 Oct 2003 Posts: 58 Location: Quebec
|
Posted: Tue Feb 15, 2005 1:35 pm Post subject: |
|
|
It's a fresh install. In my mysql table, I didn't put a default value for maildir. Is it mandatory ? Also, the version of courier-imap is 3.0.5 but I don't think this is the problem. It seems like the imap server is not retriving the good values from mysql table.
Here is the output you asked:
ADDRESS=0
PORT=143
MAXDAEMONS=40
MAXPERIP=4
PIDFILE=/var/run/imapd.pid
TCPDOPTS="-nodnslookup -noidentlookup"
AUTHMODULES="authdaemon"
AUTHMODULES_ORIG="authdaemon"
DEBUG_LOGIN=2
IMAP_CAPABILITY="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE"
IMAP_KEYWORDS=1
IMAP_CAPABILITY_ORIG="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 IDLE"
IMAP_IDLE_TIMEOUT=60
IMAP_CAPABILITY_TLS="$IMAP_CAPABILITY AUTH=PLAIN"
IMAP_CAPABILITY_TLS_ORIG="$IMAP_CAPABILITY_ORIG AUTH=PLAIN"
IMAP_DISABLETHREADSORT=0
IMAP_CHECK_ALL_FOLDERS=0
IMAP_OBSOLETE_CLIENT=0
IMAP_ULIMITD=65536
IMAP_USELOCKS=1
IMAP_SHAREDINDEXFILE=/etc/courier-imap/shared/index
IMAP_ENHANCEDIDLE=0
IMAP_TRASHFOLDERNAME=Trash
IMAP_EMPTYTRASH=Trash:7
IMAP_MOVE_EXPUNGE_TO_TRASH=0
SENDMAIL=/usr/sbin/sendmail
HEADERFROM=X-IMAP-Sender
IMAPDSTART=YES
MAILDIRPATH=Maildir
Here is an output of mysql table :
mysql> select * from users;
+-------------------------+------------------+-------------------+------+------+----------------+-------------------------+-------+---------+-----------------+------------+----------------+
| id | crypt | name | uid | gid | home | maildir | quota | enabled | change_password | procmailrc | spamassassinrc |
+-------------------------+------------------+-------------------+------+------+----------------+-------------------------+-------+---------+-----------------+------------+----------------+
| frank@secur911.com | crypt_password | frank | 1000 | 1000 | /home/virtual/ | secur911/frank/Maildir/ | | 1 | 1 | |
|
Back to top |
|
|
langthang Retired Dev
Joined: 27 Nov 2003 Posts: 620
|
Posted: Tue Feb 15, 2005 4:29 pm Post subject: |
|
|
> I didn't put a default value for maildir. Is it mandatory ?
No, I misred the previous post.
> Also, the version of courier-imap is 3.0.5
You didn't use the ebuild? 3.0.5 isn't in portage tree anymore.
> It seems like the imap server is not retriving the good values from mysql table.
tail -f /path/to/mail.log in one term, telnet mail_server 143 in the other term and try authenticate, look in the other term for any error. your previous post doesn't show any error at all. _________________ Gentoo users' map |
|
Back to top |
|
|
Ateo Advocate
Joined: 02 Jun 2003 Posts: 2022 Location: Vegas Baby!
|
|
Back to top |
|
|
|