Приветсвую.Собрался поднять IMAP на сервере с виртуальными юзерами.
И конечно же ничего не получилось.
Конфиги:
$ cat authdaemonrc
authmodulelist="authpgsql"
authmodulelistorig="authpgsql"
daemons=5
authdaemonvar=/var/lib/courier/authdaemon
DEBUG_LOGIN=2
DEFAULTOPTIONS=""
LOGGEROPTS="-pid=/var/run/courierlogger.pid -facility=local4"
$ cat authpgsqlrc
PGSQL_HOST localhost
PGSQL_PORT 5432
PGSQL_USERNAME courier
PGSQL_PASSWORD **********
PGSQL_DATABASE mail
PGSQL_USER_TABLE users
PGSQL_CLEAR_PWFIELD password
PGSQL_UID_FIELD 70
PGSQL_GID_FIELD 70
PGSQL_LOGIN_FIELD login
PGSQL_HOME_FIELD '/var/sool/mail/virtual'
PGSQL_MAILDIR_FIELD maildir
$ cat imapd
ADDRESS=0
PORT=143
MAXDAEMONS=40
MAXPERIP=4
PIDFILE=/var/run/imapd.pid
TCPDOPTS="-nodnslookup -noidentlookup"
LOGGEROPTS="-name=imapd"
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 AUTH=CRAM-SHA256 IDLE"
IMAP_PROXY=0
IMAP_PROXY_FOREIGN=0
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_UMASK=022
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=NO
MAILDIRPATH=Maildir
MAILDIR=.maildir
MAILDIRPATH=.maildir
PRERUN=
LOGINRUN=
Таблица:
mail=> select * from users ;
login | password | maildir | expired | forward | comment
------------+-----------+----------------------------+---------+---------+-----------------
postmaster | 123456789 | domain.ru/postmaster/ | 0 | - | postmaster mail
(1 row)
Лог:
May 8 18:56:08 l2 authdaemond: received auth request, service=imap, authtype=login
May 8 18:56:08 l2 authdaemond: authpgsql: trying this module
May 8 18:56:08 l2 authdaemond: SQL query: SELECT login, '', password, 70, 70, '/var/sool/mail/virtual', maildir, '', '', '' FROM users WHERE login = 'postmaster'
May 8 18:56:08 l2 authdaemond: authpgsql: sysusername=<null>, sysuserid=70, sysgroupid=70, homedir=/var/sool/mail/virtual, address=postmaster, fullname=<null>, maildir=domain.ru/postmaster/, quota=<null>, options=<null>
May 8 18:56:08 l2 authdaemond: authpgsql: clearpasswd=123456789, passwd=<null>
May 8 18:56:08 l2 authdaemond: Authenticated: sysusername=<null>, sysuserid=70, sysgroupid=70, homedir=/var/sool/mail/virtual, address=postmaster, fullname=<null>, maildir=domain/postmaster/, quota=<null>, options=<null>
May 8 18:56:08 l2 authdaemond: Authenticated: clearpasswd=123456789, passwd=<null>
Лог почтового клиента:
*** Session started : 08.05.2007 18:55:51, 18:55:51
S: * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2005 Double Precision, Inc. See COPYING for distribution information.
C: E00001 CAPABILITY
S: * CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS
C: B00002 Login "postmaster" "123456789"
S: E00001 OK CAPABILITY completed
S: * BYE Temporary problem, please try again later
S: !! Socket status 0
*** Session finished : 08.05.2007 18:55:52, 18:55:52