SASL (after PF RPM removal)

From: Robin Lynn Frank (PF) ("Robin)
Date: Sat Jan 01 2005 - 14:02:35 EST

  • Next message: Roy S. Rapoport: "Re: [OT] Dns servers"

    When I originally set this server up, it had postfix installed by a
    Mandrake 10.0 RPM, When I removed the postfix RPMs and replaced them
    with one compiled from source. While this didn't impact our ability to
    authenticate with our ISP's server, it did break our server-side stuff
    since some files were removed when the RPMs were.

    We want to permit smtpauth only for real users and use the simplest
    config. What would be best? Also, would we have to change the init
    script that saslauthd is started with? (Script below.)

    #!/bin/sh
    #
    # saslauthd SASL AUTH Daemon
    #
    # chkconfig: 2345 40 60
    # description: SASL AUTH Daemon
    # processname: saslauthd
    # pidfile: /var/lock/subsys/saslauthd

    # $Id: saslauthd.init,v 1.1 2001/05/02 10:55:48 wiget Exp $

    # Source function library
    . /etc/rc.d/init.d/functions

    #Mux file directory
    MUXDIR="/var/lib/sasl2"

    #Postfix spool directory (need to have the mux there as well)
    PFDIR="/var/spool/postfix"

    # Get service config
    [ -f /etc/sysconfig/saslauthd ] && . /etc/sysconfig/saslauthd

    # mech_options must be specified before the auth method

    if [ "x$SASL_MECH_OPTIONS" != "x" ] ; then
            SASLAUTHD_OPTS="$SASLAUTHD_OPTS -O $SASL_MECH_OPTIONS"
    fi

    # compatibility with previous versions
    if [ "x$SASL_RIMAP_HOSTNAME" != "x" ] ; then
            SASLAUTHD_OPTS="$SASLAUTHD_OPTS -O $SASL_RIMAP_HOSTNAME"
    fi

    if [ "x$SASL_AUTHMECH" != "x" ] ; then
            SASLAUTHD_OPTS="$SASLAUTHD_OPTS -a $SASL_AUTHMECH"
    fi

    # See how we were called.
    case "$1" in
       start)
            # Check if the service is already running?
             if [ ! -f /var/lock/subsys/saslauthd ]; then
                    gprintf "Starting saslauthd"
                    daemon saslauthd $SASLAUTHD_OPTS
                    echo
                    RETVAL=$?
                         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/saslauthd
            else
                     gprintf "saslauthd already running"
                    echo
                    exit 1
            fi
            # Check if Postfix is present and make a hardlink so
             # smtp auth can work
            if [ -e $PFDIR -a ! -e $PFDIR$MUXDIR ]; then
                    gprintf "Creating %s%s\n" "$PFDIR" "$MUXDIR"
                    mkdir -p $PFDIR$MUXDIR
            fi
             if [ ! -e $PFDIR$MUXDIR/mux ];then
                    if [ ! -e $MUXDIR/mux ];then
                      gprintf "Mux not ready... Sleeping 1 second\n"
                      sleep 1
                    fi
                    gprintf "Creating hardlink from %s/mux to %s%s/\n" "$MUXDIR" "$PFDIR"
    "$MUXDIR"
                    ln -f $MUXDIR/mux $PFDIR$MUXDIR/
            fi
            ;;
       stop)
             # Stop daemons.
            if [ -f /var/lock/subsys/saslauthd ]; then
                     gprintf "Stopping saslauthd"
                     killproc saslauthd
                    echo
                     rm -f /var/lock/subsys/saslauthd /var/run/saslauthd.pid
    >/dev/null 2>&1
             else
                    gprintf "saslauthd not running"
                    echo
                    exit 1
            fi
             if [ -e $PFDIR$MUXDIR/mux ];then
                    gprintf "Deleting %s%s/mux\n" "$PFDIR" "$MUXDIR"
                    rm -f $PFDIR$MUXDIR/mux
            fi
            ;;
       status)
            status saslauthd
            exit $?
            ;;
       restart|reload)
            $0 stop
            $0 start
            ;;
       *)
            gprintf "%s {start|stop|restart|status}\n" "$0"
            exit 1
            ;;
    esac

    exit $RETVAL

    --
    Robin Lynn Frank - Director of Operations - Paradigm-Omega, LLC
    Website:   http://www.paradigm-omega.com/
    RSS:       http://paradigm-omega.blogspot.com/atom.xml
    Spamtraps: http://paradigm-omega.net/cgi-bin/custmail.cgi
    =====================================================================
    In some circles, spam prevention with fewer leters than LART is frowned
    upon. (i.e., SPF, SRS, C/R, SAV, DK, SID).  Hope they like spam.
    
    



  • Next message: Roy S. Rapoport: "Re: [OT] Dns servers"





    Hosted Email Solutions

    Invaluement Anti-Spam DNSBLs



    Powered By FreeBSD   Powered By FreeBSD