Virtual Users And Domains With Postfix, Courier And MySQL: POP/IMAP authentication

Discussion in 'HOWTO-Related Questions' started by SeanG, Dec 18, 2005.

  1. SeanG

    SeanG New Member

    Great tutorial.

    I set this up on a clean Sarge install. Had a few problems which have been resolved by reading this and other forums. This particular one has had me going for days -I have followed all the steps in related threads on this forum.

    I am unable to connect using pop or imap on the LAN (so no firewall issues). The error I get is:

    Dec 17 21:48:29 netserver authdaemond.mysql: failed to connect to mysql server (server=localhost , userid=mail_admin)

    mysql is up and running and "mysql -h localhost -u mail_admin -p" works just fine. Postfix can connect to the DB because mail is being delivered to the correct place. SASL is not working but I think that this is unrelated and should have no effect.

    Here is my /etc/courier/authdaemonrc # comments removed to make it shorter

    ##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $

    authmodulelist="authmysql"

    authmodulelistorig="authcustom authcram authuserdb authldap authpgsql authmysql authpam"
    daemons=5

    version=""

    authdaemonvar=/var/run/courier/authdaemon



    and my /etc/courier/authmysqlrc # comments removed to make it shorter
    I have no whitespace at the end of lines and in all cases field and value are separated by a single space.

    ##VERSION: $Id: authmysqlrc,v 1.17 2004/04/20 01:38:17 mrsam Exp $
    #
    # authmysqlrc created from authmysqlrc.dist by sysconftool

    MYSQL_SERVER localhost
    MYSQL_USERNAME mail_admin
    MYSQL_PASSWD myownpassword
    MYSQL_PORT 0
    MYSQL_OPT 0
    MYSQL_DATABASE mail
    MYSQL_USER_TABLE users
    MYSQL_CRYPT_PWFIELD password
    # MYSQL_CLEAR_PWFIELD clear
    MYSQL_UID_FIELD 5000
    MYSQL_GID_FIELD 5000
    MYSQL_HOME_FIELD "/home/vmail"
    MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
    MYSQL_QUOTA_FIELD quota

    I am pretty much a LINUX newbie, happ to investigate this myself but need some pointers as to where to start

    Thanks
     
  2. falko

    falko Super Moderator

    I think you should check /etc/courier/authmysqlrc again, especially the format (tabs, spaces, etc.). Courier is very finicky about the format.
     
  3. SeanG

    SeanG New Member

    hmm - reading through my post with the comments stripped out made this easy. It was the content, not the format - i.e. finger trouble... :eek:
     
  4. bLuTm8

    bLuTm8 New Member

    the error is in this entry:
    this is the name of the table used by authdaemon, not the table content

    example:
    Code:
    MYSQL_MAILDIR_FIELD maildir
     

Share This Page