Postfix: smtpd --> SASL LOGIN authentication failed

Discussion in 'General' started by tom, Sep 21, 2006.

  1. tom

    tom Member

    I don't now why but I can't login and send emails whith my emailaccout from outsite for example whith an emailclient.

    I've done this: http://www.howtoforge.com/perfect_setup_debian_sarge

    In /var/log/mail.err I found that:
    Code:
    SASL LOGIN authentication failed
    In /var/log/mail.log I found that:
    Code:
    Sep 21 23:52:03 server01 postfix/smtpd[26732]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
    Sep 21 23:52:03 server01 postfix/smtpd[26732]: warning: SASL authentication failure: Password verification failed
    Sep 21 23:52:03 server01 postfix/smtpd[26732]: warning: dslb-088-073-067-12.pools.arcor-ip.net[88.73.67.12]: SASL PLAIN authentication failed
    Sep 21 23:52:03 server01 postfix/smtpd[26732]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
    Sep 21 23:52:03 server01 postfix/smtpd[26732]: warning: dslb-088-073-067-2.pools.arcor-ip.net[88.73.67.12]: SASL LOGIN authentication failed
    Sep 21 23:52:05 server01 postfix/smtpd[26732]: lost connection after AUTH from dslb-088-073-067-108.pools.arcor-ip.net[88.73.67.12]
    Sep 21 23:52:05 server01 postfix/smtpd[26732]: disconnect from dslb-088-073-067-12.pools.arcor-ip.net[88.73.67.12]
    So, I don't know how to fix this authentication problem whith postfix smtpd.

    I even only see this output should'nt it show the saslauthd or starts postfix it if nessesary?
    Code:
    server01:~# ps ax|grep sasl
     2206 pts/1    R+     0:00 grep sasl

    Are there some postfix-professionals around the world they now what to do?
     
    Last edited: Sep 22, 2006
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you get an error when you start saslauthd with its start script in /etc/init.d ?
     
  3. tom

    tom Member

    No.
    That is find in /var/log/authd.log:
    Code:
    Sep 22 09:39:01 server01 CRON[9849]: (pam_unix) session closed for user root
    Sep 22 10:09:01 server01 CRON[10237]: (pam_unix) session opened for user root by (uid=0)
    Sep 22 10:09:01 server01 CRON[10237]: (pam_unix) session closed for user root
    Sep 22 10:10:12 server01 sshd[10259]: Accepted keyboard-interactive/pam for root from ::ffff:88.73.82.144 port 10565 ssh2
    Sep 22 10:10:12 server01 sshd[10264]: (pam_unix) session opened for user root by root(uid=0)
    
    But why I don't see the saslauthd with ps ax after I've started it?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The output from the authd.log comes from your ssh and not sasl daemon. Do you get any errors in the syslog when you start saslauthd?
     
  5. tom

    tom Member

    Now, nothing in syslog

    But you misunderstood my question:
    Code:
    But why I don't see the saslauthd with ps ax after I've started it?
    I mean, should'nt ps ax show the saslauthd in the proceslist after I've started it by running "/etc/init.d/saslauthd"?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    If saslauthd died directly after yo started it, you wont find it in ps -aux, thats why I asked for the syslog.
     
  7. falko

    falko Super Moderator ISPConfig Developer

    What's in /etc/default/saslauthd? Did you also change /etc/init.d/saslauthd, as shown in the tutorial?
     
  8. tom

    tom Member

    Yeh the solution:)
    Yes, I've change it. But I've done a mistake. Your tutorial says to put

    in /etc/init.d/saslauthd

    but I've put this ":" bloddy colon on the end of the row...
    Thank a lot for your help. I was searching hours and hours but I could*nt find anything.
    Thanks falko.:)
     
  9. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Hi Til,

    Sorry for bugging you guys with dumb questions, but I followed your upgrade tutorial for upgrading Ubuntu to 8.04. Everything works fine, except for the problem identified in this thread. I'm sure it's a typo, but I'm not seeing it. I copied the /etc/default/saslauthd from your tutorial, was I supposed to append that to the one created during the upgrade - or overwrite the one created during upgrade?

    Here's my file:

    Code:
    #
    # Settings for saslauthd daemon
    # Please read /usr/share/doc/sasl2-bin/README.Debian for details.
    #
    
    # Should saslauthd run automatically on startup? (default: no)
    START=yes
    
    # Description of this saslauthd instance. Recommended.
    # (suggestion: SASL Authentication Daemon)
    DESC="SASL Authentication Daemon"
    
    # Short name of this saslauthd instance. Strongly recommended.
    # (suggestion: saslauthd)
    NAME="saslauthd"
    
    # 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 -m /var/run/saslauthd)
    # Note: You MUST specify the -m option or saslauthd won't run!
    #
    # See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
    # See the saslauthd man page for general information about these options.
    #
    # Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
    #OPTIONS="-c -m /var/run/saslauthd"
    OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
    
    
     
  10. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Not sure what the heck is going on, but I have 2 mux files. Wonder if that's the problem????

    Code:
    root@inferno:/etc/default# ls -l /var/spool/postfix/var/run/saslauthd /var/run/saslauthd/
    /var/run/saslauthd/:
    total 4
    srwxrwxrwx 1 root root 0 2008-06-29 22:23 mux
    -rw------- 1 root root 0 2008-06-29 22:23 mux.accept
    -rw------- 1 root root 6 2008-06-29 22:23 saslauthd.pid
    
    /var/spool/postfix/var/run/saslauthd:
    total 4
    srwxrwxrwx 1 root root 0 2008-06-29 19:54 mux
    -rw------- 1 root root 0 2008-06-29 19:54 mux.accept
    -rw------- 1 root root 6 2008-06-29 19:54 saslauthd.pid
     
  11. DantePasquale

    DantePasquale Member HowtoForge Supporter

    If I start saslauthd in debug/logging mode from command line things work:
    Code:
    root@inferno:/etc/init.d# saslauthd -a pam  -n 5  -V -c -m /var/spool/postfix/var/run/saslauthd -r -d
    saslauthd[14011] :main            : num_procs  : 5
    saslauthd[14011] :main            : mech_option: NULL
    saslauthd[14011] :main            : run_path   : /var/spool/postfix/var/run/saslauthd
    saslauthd[14011] :main            : auth_mech  : pam
    saslauthd[14011] :cache_alloc_mm  : mmaped shared memory segment on file: /var/spool/postfix/var/run/saslauthd/cache.mmap
    saslauthd[14011] :cache_init      : bucket size: 96 bytes
    saslauthd[14011] :cache_init      : stats size : 36 bytes
    saslauthd[14011] :cache_init      : timeout    : 28800 seconds
    saslauthd[14011] :cache_init      : cache table: 985828 total bytes
    saslauthd[14011] :cache_init      : cache table: 1711 slots
    saslauthd[14011] :cache_init      : cache table: 10266 buckets
    saslauthd[14011] :cache_init_lock : flock file opened at /var/spool/postfix/var/run/saslauthd/cache.flock
    saslauthd[14011] :ipc_init        : using accept lock file: /var/spool/postfix/var/run/saslauthd/mux.accept
    saslauthd[14011] :detach_tty      : master pid is: 0
    saslauthd[14011] :ipc_init        : listening on socket: /var/spool/postfix/var/run/saslauthd/mux
    saslauthd[14011] :main            : using process model
    saslauthd[14012] :get_accept_lock : acquired accept lock
    saslauthd[14011] :have_baby       : forked child: 14012
    saslauthd[14011] :have_baby       : forked child: 14013
    saslauthd[14011] :have_baby       : forked child: 14014
    saslauthd[14011] :have_baby       : forked child: 14015
    saslauthd[14012] :rel_accept_lock : released accept lock
    saslauthd[14012] :cache_get_rlock : attempting a read lock on slot: 1473
    saslauthd[14012] :cache_lookup    : [login=web8_xxxxxxxx] [service=] [realm=smtp]: not found, update pending
    saslauthd[14012] :cache_un_lock   : attempting to release lock on slot: 1473
    saslauthd[14013] :get_accept_lock : acquired accept lock
    saslauthd[14012] :cache_get_wlock : attempting a write lock on slot: 1473
    saslauthd[14012] :cache_commit    : lookup committed
    saslauthd[14012] :cache_un_lock   : attempting to release lock on slot: 1473
    saslauthd[14012] :do_auth         : auth success: [user=web8_xxxxxxxx] [service=smtp] [realm=] [mech=pam]
    saslauthd[14012] :do_request      : response: OK
    So, what's wrong with /etc/default/saslauthd? or is there another config file for sasl that it's getting it's settings from???
     
  12. DantePasquale

    DantePasquale Member HowtoForge Supporter

    OK, I found the problem, but don't have a clue on what to do about it. Turns out the /etc/init.d/saslauthd does not look at the OPTIONS parameter from /etc/defaults/saslauthd !!!! Here's the trace ....

    Code:
    ++ MECH_OPTIONS=
    ++ THREADS=5
    ++ OPTIONS='-c -m /var/spool/postfix/var/run/saslauthd -r'
    + '[' yes '!=' yes ']'
    + '[' xpam = x ']'
    + PARAMS=' -a pam'
    + START='--start --quiet --pidfile /var/spool/postfix/var/run/saslauthd/saslauthd.pid --startas /usr/sbin/saslauthd --name saslauthd --  -a pam'
    + case "${1}" in
    + echo -n 'Starting SASL Authentication Daemon: '
    Starting SASL Authentication Daemon: ++ dpkg-statoverride --list /var/run/saslauthd
    + dir='root sasl 710 /var/run/saslauthd'
    + test -z 'root sasl 710 /var/run/saslauthd'
    + createdir root sasl 710 /var/run/saslauthd
    + '[' -d /var/run/saslauthd ']'
    + mkdir -p /var/run/saslauthd
    + chown -c -h root:sasl /var/run/saslauthd
    changed ownership of `/var/run/saslauthd' to root:sasl
    + chmod -c 710 /var/run/saslauthd
    mode of `/var/run/saslauthd' changed to 0710 (rwx--x---)
    [COLOR="Red"]+ start-stop-daemon --start --quiet --pidfile /var/spool/postfix/var/run/saslauthd/saslauthd.pid --startas /usr/sbin/saslauthd --name saslauthd -- -a pam[/COLOR]
    + echo saslauthd.
    saslauthd.
    So, anyone know how to fix/get the correct /etc/init.d/saslauthd file????

    I'm thinking I have to re-install some package, but don't know which one and what to do after. Any ideas???
     
  13. falko

    falko Super Moderator ISPConfig Developer

    What's in your /etc/init.d/saslauthd right now?
     
  14. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Hi Falko, sorry I forgot to post the /etc/default/saslauthd files contents:
    Code:
    #
    # Settings for saslauthd daemon
    # Please read /usr/share/doc/sasl2-bin/README.Debian for details.
    #
    
    # Should saslauthd run automatically on startup? (default: no)
    START=yes
    
    # Description of this saslauthd instance. Recommended.
    # (suggestion: SASL Authentication Daemon)
    DESC="SASL Authentication Daemon"
    
    # Short name of this saslauthd instance. Strongly recommended.
    # (suggestion: saslauthd)
    NAME="saslauthd"
    
    # 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 -m /var/run/saslauthd)
    # Note: You MUST specify the -m option or saslauthd won't run!
    #
    # See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
    # See the saslauthd man page for general information about these options.
    #
    # Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
    #OPTIONS="-c -m /var/run/saslauthd"
    OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
     
  15. falko

    falko Super Moderator ISPConfig Developer

    What's in /etc/init.d/saslauthd?
     
  16. DantePasquale

    DantePasquale Member HowtoForge Supporter

    cat /etc/init.d/saslauthd:

    Code:
    #!/bin/sh -e
    set -x
    
    NAME=saslauthd
    DAEMON="/usr/sbin/${NAME}"
    DESC="SASL Authentication Daemon"
    DEFAULTS=/etc/default/saslauthd
    PWDIR=/var/run/saslauthd
    PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"
    
    createdir() {
    # $1 = user
    # $2 = group
    # $3 = permissions (octal)
    # $4 = path to directory
            [ -d "$4" ] || mkdir -p "$4"
            chown -c -h "$1:$2" "$4"
            chmod -c "$3" "$4"
    }
    
    test -f "${DAEMON}" || exit 0
    
    # Source defaults file; edit that file to configure this script.
    if [ -e "${DEFAULTS}" ]; then
        . "${DEFAULTS}"
    fi
    
    # If we're not to start the daemon, simply exit
    if [ "${START}" != "yes" ]; then
        exit 0
    fi
    
    # If we have no mechanisms defined
    if [ "x${MECHANISMS}" = "x" ]; then
        echo "You need to configure ${DEFAULTS} with mechanisms to be used"
        exit 0
    fi
    
    # Add our mechanimsms with the necessary flag
    PARAMS="${PARAMS} -a ${MECHANISMS}"
    
    START="--start --quiet --pidfile ${PIDFILE} --startas ${DAEMON} --name ${NAME} -- ${PARAMS}"
    
    # Consider our options
    case "${1}" in
      start)
            echo -n "Starting ${DESC}: "
    	dir=`dpkg-statoverride --list $PWDIR`
    	test -z "$dir" || createdir $dir
    	if start-stop-daemon ${START} >/dev/null 2>&1 ; then
    		echo "${NAME}."
    	else
    		if start-stop-daemon --test ${START} >/dev/null 2>&1; then
    			echo "(failed)."
    			exit 1
    		else
    			echo "${DAEMON} already running."
    			exit 0
    		fi
    	fi
            ;;
      stop)
            echo -n "Stopping ${DESC}: "
            if start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" \
    		--startas ${DAEMON} --retry 10 --name ${NAME} \
    		>/dev/null 2>&1 ; then
    			echo "${NAME}."
    	else
    		if start-stop-daemon --test ${START} >/dev/null 2>&1; then
    			echo "(not running)."
    			exit 0
    		else
    			echo "(failed)."
    			exit 1
    		fi
    	fi
            ;;
      restart|force-reload)
      	$0 stop
    	exec $0 start
            ;;
      *)
            echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
            exit 1
            ;;
    esac
    
    exit 0
     
  17. falko

    falko Super Moderator ISPConfig Developer

    Can you replace
    Code:
    OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
    with
    Code:
    [B][COLOR="Red"]PARAMS[/COLOR][/B]="-c -m /var/spool/postfix/var/run/saslauthd -r"
    in /etc/default/saslauthd?
     
  18. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Hi Til, no joy, still have the problem. Can you a post an edited version of saslauthd? I may not have followed your instructions in the last post.
     
  19. falko

    falko Super Moderator ISPConfig Developer

    What does your /etc/default/saslauthd look like now?
     
  20. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Code:
    cat /etc/init.d/saslauthd
    #!/bin/sh -e
    set -x
    
    NAME=saslauthd
    DAEMON="/usr/sbin/${NAME}"
    DESC="SASL Authentication Daemon"
    DEFAULTS=/etc/default/saslauthd
    PWDIR=/var/run/saslauthd
    PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"
    
    createdir() {
    # $1 = user
    # $2 = group
    # $3 = permissions (octal)
    # $4 = path to directory
            [ -d "$4" ] || mkdir -p "$4"
            chown -c -h "$1:$2" "$4"
            chmod -c "$3" "$4"
    }
    
    test -f "${DAEMON}" || exit 0
    
    # Source defaults file; edit that file to configure this script.
    if [ -e "${DEFAULTS}" ]; then
        . "${DEFAULTS}"
    fi
    
    # If we're not to start the daemon, simply exit
    if [ "${START}" != "yes" ]; then
        exit 0
    fi
    
    # If we have no mechanisms defined
    if [ "x${MECHANISMS}" = "x" ]; then
        echo "You need to configure ${DEFAULTS} with mechanisms to be used"
        exit 0
    fi
    
    # Add our mechanimsms with the necessary flag
    PARAMS="${PARAMS} -a ${MECHANISMS}"
    PARAMS="-c -m /var/spool/postfix/var/run/saslauthd -r"
    START="--start --quiet --pidfile ${PIDFILE} --startas ${DAEMON} --name ${NAME} -- ${PARAMS}"
    
    # Consider our options
    case "${1}" in
      start)
            echo -n "Starting ${DESC}: "
    	dir=`dpkg-statoverride --list $PWDIR`
    	test -z "$dir" || createdir $dir
    	if start-stop-daemon ${START} >/dev/null 2>&1 ; then
    		echo "${NAME}."
    	else
    		if start-stop-daemon --test ${START} >/dev/null 2>&1; then
    			echo "(failed)."
    			exit 1
    		else
    			echo "${DAEMON} already running."
    			exit 0
    		fi
    	fi
            ;;
      stop)
            echo -n "Stopping ${DESC}: "
            if start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" \
    		--startas ${DAEMON} --retry 10 --name ${NAME} \
    		>/dev/null 2>&1 ; then
    			echo "${NAME}."
    	else
    		if start-stop-daemon --test ${START} >/dev/null 2>&1; then
    			echo "(not running)."
    			exit 0
    		else
    			echo "(failed)."
    			exit 1
    		fi
    	fi
            ;;
      restart|force-reload)
      	$0 stop
    	exec $0 start
            ;;
      *)
            echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
            exit 1
            ;;
    esac
    
    exit 0
    
     

Share This Page