Problem with postfix tutorial

Discussion in 'HOWTO-Related Questions' started by iamx, Apr 24, 2007.

  1. iamx

    iamx New Member

    Hi.
    I tried to set up my mailserver like in this tutorial
    Virtual Users And Domains With Postfix, Courier And MySQL (Ubuntu 6.10 Edgy Eft)

    I can send emails to my server from another email address, and i can collect emails from my server using imap protocol, but i cant send mails from my server (e.g. with thunderbird).

    I googled alot but I could not find any useful information. :(

    error message from /var/log/mail.log
    Code:
    Apr 24 18:27:13 v914 saslauthd[24494]: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module
    Apr 24 18:27:13 v914 saslauthd[24494]: do_auth         : auth failure: [[email protected]] [service=smtp] [realm=example.info] [mech=pam] [reason=PAM auth error]
    Apr 24 18:27:13 v914 saslauthd[24493]: (pam_unix) check pass; user unknown
    Apr 24 18:27:13 v914 saslauthd[24493]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
    Apr 24 18:27:15 v914 saslauthd[24493]: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module
    Apr 24 18:27:15 v914 saslauthd[24493]: do_auth         : auth failure: [[email protected]] [service=smtp] [realm=example.info] [mech=pam] [reason=PAM auth error]
    
    (ofcourse [email protected] stands for my real username and realm)

    error message from /var/log/auth.log
    Code:
    Apr 24 18:01:55 v914 postfix/smtpd[21667]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
    Apr 24 18:01:58 v914 postfix/smtpd[21667]: warning: SASL authentication failure: cannot connect to saslauthd server: Permission denied
    Apr 24 18:01:58 v914 postfix/smtpd[21667]: warning: SASL authentication failure: Password verification failed
    Apr 24 18:01:58 v914 postfix/smtpd[21667]: warning: dslc-082-082-074-037.pools.arcor-ip.net[MYIP]: SASL PLAIN authentication failed: generic failure
    

    I think its a problem with saslauthd. But I can't find out what I do wrong.

    This are my configurationfiles:

    /etc/default/saslauthd
    Code:
    START=yes
    
    PARAMS="-m /var/spool/postfix/var/run/saslauthd -r"
    
    PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"
    
    
    # You must specify the authentication mechanisms you wish to use.
    # This defaults to "pam" for PAM support, but may also include
    # "shadow" or "sasldb", like this:
    # MECHANISMS="pam shadow"
    
    MECHANISMS="pam"
    

    /etc/postfix/sasl/smtpd.conf

    Code:
    pwcheck_method: saslauthd
    
    mech_list: PLAIN LOGIN
    
    allow_plaintext: true
    
    auxprop_plugin: mysql
    
    sql_hostnames: 127.0.0.1
    
    sql_user: USER
    
    sql_passwd: PW
    
    sql_database: mail
    
    sql_select: select password from users where email = '%u'
    
    (USER and PW = real username and pw ;))


    vi /etc/pam.d/smtp

    Code:
    auth    required   pam_mysql.so user=USER passwd=PW host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
    
    account sufficient pam_mysql.so user=USER passwd=PW host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
    MySQL username and password information is correct in all files!

    If anyone knows a solution please help me.

    thx
    /iamx
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please have a look in the mysql logfile. Are any errors when pam tries to connect to the mysql server or when the sql query is executed?
     
  3. iamx

    iamx New Member

    hi.

    I'm sorry, but there is no entry in the mysql logfile.

    but I found some more information in the syslog file

    Code:
    Apr 25 16:31:38 v914 postfix/smtpd[19825]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
    Apr 25 16:31:38 v914 postfix/smtpd[19825]: connect from dslb-088-070-025-176.pools.arcor-ip.net[IP]
    Apr 25 16:31:42 v914 postfix/smtpd[19825]: warning: SASL authentication failure: Password verification failed
    Apr 25 16:31:42 v914 postfix/smtpd[19825]: warning: dslb-088-070-025-176.pools.arcor-ip.net[IP]: SASL PLAIN authentication failed: authentication failure
    Apr 25 16:31:44 v914 postfix/smtpd[19825]: warning: dslb-088-070-025-176.pools.arcor-ip.net[IP]: SASL LOGIN authentication failed: authentication failure
    Apr 25 16:31:47 v914 postfix/smtpd[19825]: disconnect from dslb-088-070-025-176.pools.arcor-ip.net[IP]
    
    /iamx
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please check if logging is enabled in the mysql my.cnf file.
     
  5. iamx

    iamx New Member

    Yes I think logging is enabled.

    my.cnf says:

    Code:
    log = /var/log/mysql/mysql.log
    mysql.log file is empty!
     
  6. falko

    falko Super Moderator ISPConfig Developer

    Did you set up saslauthd exactly as shown in the tutorial? What's the output of
    Code:
    ps aux | grep saslauthd
    ?
     
  7. iamx

    iamx New Member

    This is the output of "ps aux | grep saslauthd"

    Code:
    root     14034  0.0  0.0   6168   972 ?        Ss   Apr26   0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
    root     14035  0.0  0.0   6168   584 ?        S    Apr26   0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
    root     14037  0.0  0.0   6168   524 ?        S    Apr26   0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
    root     14039  0.0  0.0   6168   524 ?        S    Apr26   0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
    root     14040  0.0  0.0   6168   524 ?        S    Apr26   0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
    root     16183  0.0  0.0   1504   504 pts/0    S+   08:12   0:00 grep saslauthd
     
  8. falko

    falko Super Moderator ISPConfig Developer

    What's in your /etc/postfix/main.cf?
     
  9. iamx

    iamx New Member

    Hi,
    this is my main.cf

    Code:
    myhostname = MYHOST
    mydestination = MYHOST, localhost, localhost.localdomain
    mynetworks = 127.0.0.0/8
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_use_tls = yes
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_mailbox_extended = yes
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    smtpd_sasl_security_options = noanonymous
    #append_dot_mydomain = no
    #biff = no
    #disable_vrfy_command = yes
    #strict_rfc821_envelopes = yes
    #smtpd_helo_required = yes
    #message_size_limit = 31457280
     

Share This Page