Virtual Users And Domains With Postfix, Courier And MySQL (Debian Etch)

Discussion in 'HOWTO-Related Questions' started by oberinspector, Jul 5, 2007.

  1. oberinspector

    oberinspector New Member

    I followed the mentioned howto... i can receive pop email with thunderbird, but when i try to send an email it fails...

    in mail.log:

    Code:
    Jul  5 22:44:11 empego postfix/smtpd[5575]: warning: SASL authentication failure: Password verification failed
    Jul  5 22:44:11 empego postfix/smtpd[5575]: warning: p548AC7D5.dip.t-dialin.net[84.138.199.213]: SASL PLAIN authentication failed: authentication failure
    Jul  5 22:44:12 empego postfix/smtpd[5575]: warning: p548AC7D5.dip.t-dialin.net[84.138.199.213]: SASL LOGIN authentication failed: authentication failure
    in auth.log:

    Code:
    Jul  5 22:44:12 empego saslauthd[5568]: pam_mysql - required option "db" is not set
    Jul  5 22:44:12 empego saslauthd[5568]: DEBUG: auth_pam: pam_authenticate failed: Error in service module
    Jul  5 22:44:12 empego saslauthd[5568]: do_auth         : auth failure: [[email protected]] [service=smtp] [realm=yyy.zzz] [mech=pam] [reason=PAM auth error]
    
    looks like /etc/pam.d/smtp (a symlink to /etc/pam.d/imap) is not read...
    /etc/pam.d/smtp:
    Code:
    auth    required   pam_mysql.so user=mail_admin passwd=secret host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1 verbose=1
    account sufficient pam_mysql.so user=mail_admin passwd=secret host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1 verbose=1
    Code:
    /etc/potix/sasl/smtp.conf:
    pwcheck_method: saslauthd
    mech_list: plain login
    allow_plaintext: true
    auxprop_plugin: mysql
    sql_hostnames: 127.0.0.1
    sql_user: mail_admin
    sql_passwd: secret
    sql_database: mail
    sql_select: SELECT password FROM users where email = '%u'
    Code:
    empego:/etc# ps aux | grep saslauthd
    root      5566  0.0  0.1  30308  1152 ?        Ss   22:43   0:00 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
    root      5567  0.0  0.1  30308  1468 ?        S    22:43   0:00 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
    root      5568  0.0  0.1  30308  1468 ?        S    22:43   0:00 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
    root      5569  0.0  0.0  30308   672 ?        S    22:43   0:00 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
    root      5574  0.0  0.0  30308   484 ?        S    22:43   0:00 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
    

    i read some threads and tried a lot, but nothing helped... any idea what i can do!?
     
    Last edited: Jul 10, 2007
  2. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -l /etc/pam.d
    ? What's in /etc/pam.conf?
     
  3. oberinspector

    oberinspector New Member

    Output of ls -l /etc/pam.d:

    Code:
    empego:~# ls -l /etc/pam.d
    total 96
    -rw-r--r-- 1 root root  182 2006-03-18 20:13 atd
    -rw-r--r-- 1 root root  384 2006-10-22 08:38 chfn
    -rw-r--r-- 1 root root  581 2006-10-22 08:38 chsh
    -rw-r--r-- 1 root root  392 2006-07-04 21:05 common-account
    -rw-r--r-- 1 root root  436 2006-07-04 21:05 common-auth
    -rw-r--r-- 1 root root 1097 2006-07-04 21:05 common-password
    -rw-r--r-- 1 root root  372 2006-07-04 21:05 common-session
    -rw-r--r-- 1 root root  289 2006-10-13 01:01 cron
    -rw-r--r-- 1 root root   81 2006-12-18 18:38 dovecot
    -rw-r--r-- 1 root root  148 2006-06-11 19:46 esmtp
    -rw------- 1 root root  323 2007-07-05 19:36 imap
    -rw-r--r-- 1 root root  486 2007-02-13 09:39 imap.dpkg-dist
    -rw-r--r-- 1 root root  486 2007-02-13 09:39 lmtp
    -rw-r--r-- 1 root root 2843 2006-10-22 08:38 login
    -rw-r--r-- 1 root root  520 2006-07-04 21:05 other
    -rw-r--r-- 1 root root   92 2006-07-04 21:05 passwd
    lrwxrwxrwx 1 root root   15 2007-03-18 16:20 pop -> /etc/pam.d/imap
    -rw-r--r-- 1 root root  148 2006-05-31 17:37 pop3
    -rw-r--r-- 1 root root  485 2007-02-13 09:39 pop.dpkg-new
    -rw-r--r-- 1 root root  168 2006-07-04 21:05 ppp
    -rw-r--r-- 1 root root  370 2006-07-04 21:05 proftpd
    lrwxrwxrwx 1 root root   15 2007-03-18 16:20 sieve -> /etc/pam.d/imap
    -rw-r--r-- 1 root root  498 2007-02-13 09:39 sieve.dpkg-new
    lrwxrwxrwx 1 root root   15 2007-03-18 16:20 smtp -> /etc/pam.d/imap
    -rw-r--r-- 1 root root 1272 2006-11-15 02:53 ssh
    -rw-r--r-- 1 root root 2305 2006-07-14 14:24 su
    -rw-r--r-- 1 root root  113 2006-05-31 17:37 webmail
    
    content of: /etc/pam.conf:
    Code:
    empego:~# cat /etc/pam.conf
    # ---------------------------------------------------------------------------#
    # /etc/pam.conf                                                              #
    # ---------------------------------------------------------------------------#
    #
    # NOTE
    # ----
    #
    # NOTE: Most program use a file under the /etc/pam.d/ directory to setup their
    # PAM service modules. This file is used only if that directory does not exist.
    # ---------------------------------------------------------------------------#
    
    # Format:
    # serv. module     ctrl       module [path]     ...[args..]                  #
    # name  type       flag                                                      #
    
    Thanks in advance for your help!!!

    /thomas
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Can you try
    Code:
    chmod 644 /etc/pam.d/imap
    ?
     
  5. oberinspector

    oberinspector New Member

    ok... the problem is solved...

    my stupid error was to use a '#' character in my mail_admin password, which works fine for the receiving part... but in /etc/pam.d/smtp:

    Code:
    auth    required   pam_mysql.so user=mail_admin passwd=my#password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
    account sufficient pam_mysql.so user=mail_admin passwd=my#password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
    everything behind the '#' was ignored...

    again... thank you for your help!

    regards,
    thomas
     
    Last edited: Jul 10, 2007
  6. Jaac

    Jaac New Member

    I'm glad you posted the solution, because i'm having likewise problems and a am too using a password containing the number sign #
    My mail.log and auth.log entries have the same errors as yours, and am about to fix it by changing the password in all the files and database.

    I'm wondering though, would having the password wrapped in single quotes negate the special characters like in most programming language's?

    p.s. Sorry to bring up an old thread, but it is relevant to my problem.
    My install of the mail server with postfix dates from half a year back, and WAS running perfect, but i lately changed the password and then the problems started.
     
    Last edited: Jan 26, 2011
  7. adig

    adig New Member

    #

    OMG :)) ,

    i can't believe i've spent more than an hour @3AM troubleshooting this setup, only to find out that i used a # sign in the password.

    This forum is great!
     

Share This Page