Hello,
(posting to postfixadmin-devel again - this might be interesting for
more people. Please send your replies to the mailinglist also.)
Am Mittwoch, 11. Juni 2008 schrieb Stefan Breitegger:
> Zitat von Christian Boltz <pos...@cb...>:
...
> > So: What exactly do you want to do? What's the problem?
>
> Please send me a working authmysqlrc with a custom sql query working
> with postfix-admin! I don't know how to set the correct queries for
> the 2 tables (alias and mailbox). I was glad setting up the correct
> MYSQL query for the mailbox table....
You don't need the aliases for courier-authlib. The mailbox table contains
everything you need ;-)
Here's the config I'm using on a server with courier-authlib-0.58.
It still uses the old-style syntax with lots of MYSQL_* variables, but
works perfectly - so why should I change it?
# grep '^[^#]' authdaemonrc
authmodulelist="authmysql"
authmodulelistorig="authuserdb authpam authldap authmysql authcustom authpipe"
daemons=5
authdaemonvar=/var/run/authdaemon.courier-imap
DEBUG_LOGIN=0
DEFAULTOPTIONS=""
LOGGEROPTS=""
# grep '^[^#]' authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME mail-courier
MYSQL_PASSWORD your_password_here
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_OPT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE mailbox
MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD '20000'
MYSQL_GID_FIELD '10002'
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD '/home/mailbox/'
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD concat(quota,'S')
MYSQL_WHERE_CLAUSE active=1
Yes, I'm storing cleartext passwords in my database. Not nice, but it
works quite good ;-) You might want to use
MYSQL_CRYPT_PWFIELD password
instead if you store your passwords encrypted.
You will also need to change MYSQL_UID_FIELD and MYSQL_GID_FIELD. They
are set to a static UID and GID. This has to match the user that owns
your mailboxes directory.
BTW: The only permissions the MySQL user needs are SELECT permissions on
the mailbox table.
Regards,
Christian Boltz
--
Das terrorsicherste Verkehrsmittel ist ganz klar das Automobil. Einzeln
verpackte Verkehrsteilnehmer in Stahlhülle mit großen Abständen. :)
[Kristian Köhntopp auf
http://blog.koehntopp.de/archives/1376-Mach-mir-den-Rail-Marshall.html]
|