LFS 5.1.1 and mimedefang

Jason Gurtz jason at tommyk.com
Wed Dec 8 11:35:45 PST 2004


On 12/8/2004 01:41, zareh at dslextreme.com wrote:

> http://lists.roaringpenguin.com/pipermail/mimedefang/2004-December/025544.html

I saw this but was at a loss to guess why.  Best I can do is post my
startup script which works fine for me.  It's running on an
LFS-4.something box.  Note that it's a low powered box (P1-166MMX, 256MB,
5400RPM IDE) running webmail and etc..., so my specific MD settings will
probably be a little different than what you'd use.  Still, when setting
the system up I found that the order in which things are started and shut
down matters.  The script is a work in progress so just ignore things that
seem out of place  :)

<paste file="/etc/init.d/sendmail">

#!/bin/sh
#
# (c) 11/23/2002, David A. Desrosiers
#     hacker at gnu dash designs dot com
#
#
# (c)2003, Jason L. Gurtz
#          jason(at)tommyk(dot)com
#
#     Sendmail, MIMEDefang, SpamAssassin startup
#
#####################################################################

#--------------------------+
# Global Sendmail settings |
#--------------------------+
DAEMON="yes"
QUEUE="5m"
SENDMAIL="/usr/sbin/sendmail"

#----------------------------+
# Global MIMEDefang settings |
#----------------------------+
MIMEDEFANG="/usr/bin/mimedefang"
MULTIPLEX="/usr/bin/mimedefang-multiplexor"
MIN_SLAVES="2"
MAX_SLAVES="8"
BUSY_TIMEOUT="600"
MAX_REQUESTS="500"
IDLE_TIMEOUT="180"
QUEUESIZE="30"
QUEUETIMEOUT="120"
RETVAL="0"

#------------------------------+
# Global SpamAssassin settings |
#------------------------------+
SPAMASSASSIN="/usr/bin/spamd"
SPAMMILTER="/usr/sbin/spamass-milter"
MILTERSOCKET="/var/run/spamass.sock"
# Threshhold SA score to start rejecting mail at
MILTERREJECT="7"

#-------------- End Configuration Section -----------------

source /etc/init.d/functions

case "$1" in
  start)
    echo -n "Regenerating Sendmail aliases (newaliases)..."
    loadproc /usr/bin/newaliases > /dev/null 2>&1
    echo ""

    echo -n "Regenerating hash tables for access, virtusertable..."
    for i in virtusertable access; do
      if [ -f /etc/mail/$i ] ; then
        loadproc makemap hash /etc/mail/$i < /etc/mail/$i
      fi
    done

    echo -n "Starting MIMEDefang Multiplexor..."
    loadproc                                                \
    $MULTIPLEX -x $MAX_SLAVES                               \
               -m $MIN_SLAVES                               \
               -q $QUEUESIZE                                \
               -Q $QUEUETIMEOUT                             \
               -r $MAX_REQUESTS                             \
               -b $BUSY_TIMEOUT                             \
               -i $IDLE_TIMEOUT                             \
               -s /var/spool/MIMEDefang/mdefang-mx.sock     \
               -p /var/spool/MIMEDefang/mdefang-mx.pid      \
               -U defang                                    \
               -E                                           \
               -l

    # Test to make sure it started OK
    RETVAL=$?
    [ $RETVAL -ne 0 ] && exit 1

    echo -n "Starting MIMEDefang core process..."
    ulimit -s 2048  # set stacksize smaller
    loadproc                                                \
    $MIMEDEFANG -m /var/spool/MIMEDefang/mdefang-mx.sock    \
                -p /var/spool/MIMEDefang/mimedefang.sock    \
                -P /var/spool/MIMEDefang/mimedefang.pid     \
                -k                                          \
                -T                                          \
                -U defang                                   \
                -r                                          \
                -s                                          \
                -t
    # Test to make sure it started OK
    RETVAL=$?
    [ $RETVAL -ne 0 ] && exit 1

    echo -n "Waiting a moment to let MIMEDefang slaves fully load..."
    loadproc /usr/bin/sleep 25

    ulimit -s 8192  # reset stacksize to 8MB

    echo ""
    echo -n "Starting Sendmail MTA Listener process..."
    loadproc                                           \
    $SENDMAIL   -v $([ "$DAEMON" = yes ] && echo -bd)  \
                -L sendmail-MTA

    echo -n "Starting Sendmail queue runner process..."
    $SENDMAIL -v $([ -n "$QUEUE" ] && echo -q$QUEUE)   \
              -L sendmail-MSD-Qrunner -Ac

    RETVAL=$?
    [ $RETVAL -eq 0 ] && touch /var/lock/sendmail
  ;;

  stop)
    echo -n "Shutting down Sendmail..."
    killproc $SENDMAIL
    RETVAL=$?

    echo -n "Shutting down MIMEDefang Multiplexor.."
    killproc $MULTIPLEX
    RETVAL=$?

    echo -n "Shutting down MIMEDefang Core.."
    killproc $MIMEDEFANG 2>/dev/null
    RETVAL=$?

    [ $RETVAL -eq 0 ] && rm -f /var/lock/sendmail
  ;;

  restart|reload)
    $0 stop
    echo "Shutdown complete; now restarting..."
    $0 start
    RETVAL=$?
    echo ""
  ;;

  status)
    echo -n "SpamAssassin Milter......: "
    statusproc $SPAMMILTER

    echo -n "SpamAssassin Filter......: "
    statusproc $SPAMASSASSIN

    echo -n "MIMEDefang Multiplexor...: "
    statusproc $MULTIPLEX

    echo -n "MIMEDefang Filter........: "
    statusproc $MIMEDEFANG

    echo -n "Sendmail.................: "
    statusproc $SENDMAIL

    RETVAL=$?
    echo ""
  ;;
  *)
    echo "Usage: $0 {start|stop|reload|restart|status}"
    exit 1
  ;;
esac

# EOF

</paste>


Hope this helps

~Jason

-- 



More information about the blfs-support mailing list