SASL authentication failure

Discussion in 'HOWTO-Related Questions' started by coxeh, Aug 13, 2007.

  1. coxeh

    coxeh New Member

    Hi, thanks for the great tutorial on the mail server setup.

    However i cannot authenticate when sending emails. i keep getting this error in my mail.log

    Code:
    Aug 13 11:11:55 mail postfix/smtpd[18307]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
    Aug 13 11:11:55 mail postfix/smtpd[18307]: warning: 87-194-161-149.bethere.co.uk[87.194.161.149]: SASL LOGIN authentication failed: generic failure
    
    /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: password
    sql_database: mail
    sql_select: select password from users where email = '%u'
    mech_list: plain login
    pwcheck_method: saslauthd
    
    /etc/default/saslauthd
    Code:
    START=yes
    PARAMS="-m /var/spool/postfix/var/run/saslauthd -r"
    PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"
    MECHANISMS="pam"
    MECH_OPTIONS=""
    THREADS=5
    OPTIONS="-c"
    
    /etc/pam.d/smtp
    Code:
    auth    required   pam_mysql.so user=user passwd=password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
    account sufficient pam_mysql.so user=user passwd=password  host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
    
    /etc/postfix/main.cf
    Code:
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    append_dot_mydomain = no
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    smtpd_sasl_path = smtpd
    
    myhostname = mail.eccemedia.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = mail.eccemedia.com, localhost, localhost.localdomain
    relayhost = 
    mynetworks = 127.0.0.0/8
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    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_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_mailbox_extended = yes
    virtual_overquota_bounce = yes
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    home_mailbox = Maildir/
    mailbox_command = 
    

    I have read some of the threads on here and none have seemed to help my situation.

    does anyone have any idea what i have done wrong?

    Thanks
     
  2. drone12

    drone12 New Member

    I have the same issue....

    I followed the ...
    http://www.howtoforge.com/virtual_postfix_mysql_quota_courier_ubuntu_edgy

    Tutorial on ubuntu fiesty, and pretty much did a copy and paste of everything except the portion for quota, and anything related to quota.



    Code:
    Aug 14 01:14:34 classicaddy postfix/smtpd[12723]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
    Aug 14 01:14:34 classicaddy postfix/smtpd[12723]: warning: removedmyiphostname.net[myip]: SASL LOGIN authentication failed: generic failure
     
  3. coxeh

    coxeh New Member

    Hi i finally got it working.

    i changed my /etc/default/saslauthd to
    Code:
    #
    # Settings for saslauthd daemon
    #
    
    # Should saslauthd run automatically on startup? (default: no)
    START=yes
    
    # Which authentication mechanisms should saslauthd use? (default: pam)
    #
    # Available options in this Debian package:
    # getpwent  -- use the getpwent() library function
    # kerberos5 -- use Kerberos 5
    # pam       -- use PAM
    # rimap     -- use a remote IMAP server
    # shadow    -- use the local shadow password file
    # sasldb    -- use the local sasldb database file
    # ldap      -- use LDAP (configuration is in /etc/saslauthd.conf)
    #
    # Only one option may be used at a time. See the saslauthd man page
    # for more information.
    #
    # Example: MECHANISMS="pam"
    MECHANISMS="pam"
    
    # Additional options for this mechanism. (default: none)
    # See the saslauthd man page for information about mech-specific options.
    MECH_OPTIONS=""
    
    # How many saslauthd processes should we run? (default: 5)
    # A value of 0 will fork a new process for each connection.
    THREADS=5
    
    # Other options (default: -c)
    # See the saslauthd man page for information about these options.
    #
    # Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
    # Note: See /usr/share/doc/sasl2-bin/README.Debian
    OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

    then instead of restarting the saslauthd daemon i did

    Code:
    sudo /etc/init.d/saslauthd stop
    sudo /etc/init.d/saslauthd start
    
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Do you get any errors when you restart saslauthd?

    What's in /etc/default/saslauthd?
     

Share This Page