Hi Steffen,

as discussed on IRC here my affected sample setup.

0.) This setup need the packages courier-authlib, courier-authlib-mysql
    courier-authdaemon and maildrop installed (no Courier mailserver
    needed).

1.) I created a MySQL database with the following SQL statement:

        CREATE DATABASE mailauth;

2.) Then I created a table "passwd" and populated it with some test
    data (see file mailauth.sql in the attached tarball).

3.) Then I granted SELECT rights to the MySQL user "maildrop" to be
    used by maildrop for sample mail delivery using the following
    SQL statement:

        GRANT SELECT ON mailauth.passwd TO maild...@localhost
                        IDENTIFIED BY PASSWORD 'aLongPassword';

4.) The configuration files for courier-authdaemon and
    courier-authlib-mysql (contained in the attached tarball)
    should be placed in /etc/courier/ (maybe a restart of
    courier-authdaemon is needed).

5.) Create the maildir and home directory for the test user
    (make sure the dirs /tmp/test-home and /tmp/test-maildir do
    not exist yet):

        mkdir /tmp/test-home
        maildirmake /tmp/test-maildir
        chown -R nobody: /tmp/test-home /tmp/test-maildir

Now the setup is complete. You can now try to deliver mail to the
test-user's maildir by running the command

        maildrop -a -d test < /dev/null

This should leave traces in /var/log/syslog like the ones posted by the
submitter of this bug report. The expected behaviour would lead to lines
like the following:

authdaemond: received userid lookup request: test
authdaemond: authmysql: trying this module
authdaemond: SQL query: SELECT id, crypt, clear, uid, gid, home,
maildir, quota, "", "" FROM passwd WHERE id = "test"" AND (maildrop='y')
authdaemond: Authenticated: sysusername=<null>, sysuserid=65534,
sysgroupid=8, homedir=/tmp/test-home, address=test, fullname=<null>,
maildir=/tmp/test-maildir, quota=<null>, options=<null>

Good luck for reproducing my weird setup. ;-)

Regards
  Micha

Attachment: 509280-affected-setup.tar.gz
Description: GNU Zip compressed data

Reply via email to