[Mimedefang] My CFO keeps crashing Mimedefang.

Joshua Graham jgraham at tranxition.com
Fri Dec 19 18:17:37 EST 2003


Everytime my CFO gets a humerous email in his home email account he
decides to forward it to everyone at work by putting their address in the
To: field.  I've asked him numerous times to stop but he does it anyway
saying "Other mail servers can handle it, why cant ours?"

Anyway, here's the error I get in the maillog


Dec 19 14:43:22 firebox sendmail[906]: hBJMh72w000906:
from=<lrhoffman at integraonline.com>, size=55908, class=0, nrcpts=1, msg
id=<LNBBJCIHGNPKGDDHICHAIEAACEAA.lrhoffman at integraonline.com>, proto=SMTP,
daemon=MTA, relay=mail-2.integraonline.com [206.16
3.82.91]
Dec 19 14:43:23 firebox sendmail[902]: hBJMh62w000902:
from=<lrhoffman at integraonline.com>, size=55908, class=0, nrcpts=1, msg
id=<LNBBJCIHGNPKGDDHICHAIEAACEAA.lrhoffman at integraonline.com>, proto=SMTP,
daemon=MTA, relay=mail-2.integraonline.com [206.16
3.82.91]
Dec 19 14:43:23 firebox mimedefang-multiplexor: Starting slave 8 (pid 918)
(4 running): About to perform scan
Dec 19 14:43:24 firebox sendmail[903]: hBJMh62w000903:
from=<lrhoffman at integraonline.com>, size=55908, class=0, nrcpts=1, msg
id=<LNBBJCIHGNPKGDDHICHAIEAACEAA.lrhoffman at integraonline.com>, proto=SMTP,
daemon=MTA, relay=mail-2.integraonline.com [206.16
3.82.91]
Dec 19 14:43:24 firebox mimedefang-multiplexor: Starting slave 3 (pid 919)
(5 running): About to perform scan
Dec 19 14:43:25 firebox sendmail[905]: hBJMh72w000905:
from=<lrhoffman at integraonline.com>, size=55908, class=0, nrcpts=1, msg
id=<LNBBJCIHGNPKGDDHICHAIEAACEAA.lrhoffman at integraonline.com>, proto=SMTP,
daemon=MTA, relay=mail-2.integraonline.com [206.16
3.82.91]
Dec 19 14:43:25 firebox mimedefang-multiplexor: Starting slave 0 (pid 920)
(6 running): About to perform scan
Dec 19 14:43:25 firebox sendmail[904]: hBJMh62w000904:
from=<lrhoffman at integraonline.com>, size=55908, class=0, nrcpts=1, msg
id=<LNBBJCIHGNPKGDDHICHAIEAACEAA.lrhoffman at integraonline.com>, proto=SMTP,
daemon=MTA, relay=mail-2.integraonline.com [206.16
3.82.91]
Dec 19 14:43:25 firebox mimedefang-multiplexor: Did not start slave 1: Not
enough time elapsed since last slave activation
Dec 19 14:43:25 firebox mimedefang-multiplexor: Unable to activate slave 1
Dec 19 14:43:25 firebox mimedefang[911]: Error from multiplexor: error:
Unable to activate slave
Dec 19 14:43:25 firebox sendmail[904]: hBJMh62w000904:
to=<aleung at tranxition.com>, delay=00:00:15, pri=85908, stat=Please try
 again later
Dec 19 14:44:25 firebox sendmail[902]: hBJMh62w000902: Milter
(mimedefang): timeout before data read
Dec 19 14:44:26 firebox sendmail[902]: hBJMh62w000902: Milter
(mimedefang): to error state
Dec 19 14:44:24 firebox sendmail[906]: hBJMh72w000906: Milter
(mimedefang): timeout before data read
Dec 19 14:44:24 firebox sendmail[908]: hBJMh72w000908: Milter
(mimedefang): timeout before data read
Dec 19 14:44:26 firebox sendmail[908]: hBJMh72w000908: Milter
(mimedefang): to error state
Dec 19 14:44:26 firebox sendmail[906]: hBJMh72w000906: Milter
(mimedefang): to error state
Dec 19 14:44:27 firebox sendmail[903]: hBJMh62w000903: Milter
(mimedefang): timeout before data read
Dec 19 14:44:27 firebox sendmail[902]: hBJMh62w000902:
to=<dsivinski at tranxition.com>, delay=00:01:17, pri=85908, stat=Please
try again later
Dec 19 14:44:27 firebox sendmail[903]: hBJMh62w000903: Milter
(mimedefang): to error state
Dec 19 14:44:27 firebox sendmail[906]: hBJMh72w000906:
to=<csmith at tranxition.com>, delay=00:01:17, pri=85908, stat=Please try
 again later
Dec 19 14:44:28 firebox sendmail[908]: hBJMh72w000908:
to=<jcreech at tranxition.com>, delay=00:01:18, pri=85908, stat=Please tr
y again later
Dec 19 14:44:27 firebox sendmail[905]: hBJMh72w000905: Milter
(mimedefang): timeout before data read
Dec 19 14:44:28 firebox sendmail[905]: hBJMh72w000905: Milter
(mimedefang): to error state
Dec 19 14:44:28 firebox sendmail[903]: hBJMh62w000903:
to=<jbowler at tranxition.com>, delay=00:01:18, pri=85908, stat=Please tr
y again later
Dec 19 14:44:31 firebox sendmail[905]: hBJMh72w000905:
to=<dbowler at tranxition.com>, delay=00:01:21, pri=85908, stat=Please tr
y again later
Dec 19 14:44:36 firebox sendmail[921]: hBJMiA2w000921:
from=<Lisa at dynic.com>, size=1090, class=0, nrcpts=1, msgid=<sfe300c0.0
58 at dynic.com>, proto=SMTP, daemon=MTA, relay=[216.64.144.90]


It's then followed by a whole bunch of this.


Dec 19 14:47:04 firebox mimedefang-multiplexor: Slave 6 died prematurely
-- check your filter rules
Dec 19 14:47:05 firebox mimedefang-multiplexor: Reap: Idle slave 6 (pid
326) exited due to signal 9 (SLAVE DIED UNEXPECTEDLY)
Dec 19 14:47:05 firebox mimedefang-multiplexor: Slave 6 resource usage:
req=3, scans=3, user=6.260, sys=1.660, nswap=0, majfl
t=5050, minflt=13523, maxrss=0, bi=0, bo=0
Dec 19 14:47:05 firebox mimedefang[913]: Error from multiplexor: ERR No
response from slave
Dec 19 14:47:11 firebox sendmail[935]: hBJMkp2w000935:
from=<astri_xberberet4302772 at check1check.com>, size=1013, class=0, nrc
pts=1, msgid=<c-81qi$g-$-oxy5r-99 at tt310>, bodytype=8BITMIME, proto=SMTP,
daemon=MTA, relay=ACC169A2.ipt.aol.com [172.193.105.
162]
Dec 19 14:47:14 firebox mimedefang-multiplexor: Starting slave 6 (pid 938)
(7 running): About to perform scan
Dec 19 14:47:24 firebox sendmail[930]: hBJMkC2w000930: Milter
(mimedefang): timeout before data read
Dec 19 14:47:25 firebox sendmail[930]: hBJMkC2w000930: Milter
(mimedefang): to error state
Dec 19 14:47:29 firebox sendmail[930]: hBJMkC2w000930:
to=<webmaster at tranxition.com>, delay=00:01:11, pri=31034, stat=Please
try again later
Dec 19 14:47:52 firebox sendmail[940]: hBJMlY2w000940:
from=<algoodk_immel2160565 at bkkmail.com>, size=1068, class=0, nrcpts=1,
 msgid=<0$ooyk1$s4992mlk$5 at y05j5.5k5ealys>, proto=SMTP, daemon=MTA,
relay=c-24-13-134-39.client.comcast.net [24.13.134.39]
Dec 19 14:47:52 firebox mimedefang-multiplexor: Starting slave 5 (pid 962)
(8 running): About to perform scan
Dec 19 14:47:55 firebox mimedefang[915]: hBJMh72w000908: smfi_chgheader
returned MI_FAILURE
Dec 19 14:47:55 firebox mimedefang[915]: hBJMh72w000908: smfi_chgheader
returned MI_FAILURE
Dec 19 14:47:55 firebox mimedefang[915]: hBJMh72w000908: smfi_addheader
returned MI_FAILURE
Dec 19 14:48:12 firebox sendmail[935]: hBJMkp2w000935: Milter
(mimedefang): timeout before data read
Dec 19 14:48:12 firebox sendmail[935]: hBJMkp2w000935: Milter
(mimedefang): to error state
Dec 19 14:48:12 firebox sendmail[935]: hBJMkp2w000935:
to=<webmaster at tranxition.com>, delay=00:01:13, pri=31013, stat=Please
try again later
Dec 19 14:48:41 firebox mimedefang-multiplexor: Slave 8 died prematurely
-- check your filter rules
Dec 19 14:48:41 firebox mimedefang-multiplexor: Reap: Idle slave 8 (pid
918) exited due to signal 9 (SLAVE DIED UNEXPECTEDLY)
Dec 19 14:48:41 firebox mimedefang-multiplexor: Slave 8 resource usage:
req=1, scans=1, user=6.010, sys=1.680, nswap=0, majfl
t=1464, minflt=8007, maxrss=0, bi=0, bo=0

Then finally after a bunch of failed "Server is busy" errors the log is
nothing but this.

Dec 19 15:21:59 firebox sendmail[1006]: hBJNLx2w001006: Milter
(mimedefang): to error state
Dec 19 15:22:48 firebox sendmail[1007]: hBJNMm2w001007: Milter
(mimedefang): error connecting to filter: Connection refused b
y /var/spool/MIMEDefang/mimedefang.sock
Dec 19 15:22:48 firebox sendmail[1007]: hBJNMm2w001007: Milter
(mimedefang): to error state
Dec 19 15:23:12 firebox sendmail[1008]: hBJNNC2w001008: Milter
(mimedefang): error connecting to filter: Connection refused b
y /var/spool/MIMEDefang/mimedefang.sock
Dec 19 15:23:12 firebox sendmail[1008]: hBJNNC2w001008: Milter
(mimedefang): to error state
Dec 19 15:23:21 firebox sendmail[1009]: hBJNNL2w001009: Milter
(mimedefang): error connecting to filter: Connection refused b
y /var/spool/MIMEDefang/mimedefang.sock
Dec 19 15:23:21 firebox sendmail[1009]: hBJNNL2w001009: Milter
(mimedefang): to error state
Dec 19 15:23:21 firebox sendmail[1010]: hBJNNL2w001010: Milter
(mimedefang): error connecting to filter: Connection refused b
y /var/spool/MIMEDefang/mimedefang.sock

I'm pulling my hair out.

Here's my mimedefang.ini in my startup directory.

#!/bin/sh
#
# Generic start/stop script for MIMEDefang.  Should work on most
# flavors of UNIX.

RETVAL=0
prog='mimedefang'
SPOOLDIR='/var/spool/MIMEDefang'
PID="$SPOOLDIR/$prog.pid"
MXPID="$SPOOLDIR/$prog-multiplexor.pid"

# Is the program executable?  We search in /usr/bin and /usr/local/bin.

if [ -x /usr/local/bin/$prog ] ; then
    PROGDIR=/usr/local/bin
elif [ -x /usr/bin/$prog ] ; then
    PROGDIR=/usr/bin
elif [ -x /usr/local/bin/$prog ] ; then
    PROGDIR=/usr/local/bin
else
    exit 0
fi

# Locale should be set to "C" for generating valid date headers
LC_ALL=C
export LC_ALL

# The settings which follow are defaults.  You can override them by
# placing assignments in /etc/mail/mimedefang.conf

# The socket used by mimedefang to communicate with sendmail
SOCKET=$SPOOLDIR/mimedefang.sock

# Run the multiplexor and filters as this user, not root.  RECOMMENDED
MX_USER=defang

# Syslog facility
# SYSLOG_FACILITY=mail

# If you want to keep spool directories around if the filter fails,
# set the next one to yes
# KEEP_FAILED_DIRECTORIES=no

# "yes" turns on the multiplexor relay checking function
# MX_RELAY_CHECK=no

# "yes" turns on the multiplexor sender checking function
# MX_SENDER_CHECK=no

# "yes" turns on the multiplexor recipient checking function
# MX_RECIPIENT_CHECK=no

# Set to yes if you want the multiplexor to log events to syslog
MX_LOG=yes

# The multiplexor does not start all slaves at the same time.  Instead,
# it starts one slave every MX_SLAVE_DELAY seconds when the system is
idle.
# (If the system is busy, the multiplexor starts slaves as incoming mail
# requires attention.)
MX_SLAVE_DELAY=3

# The next setting is an absolute limit on slave activation.  The
multiplexor
# will NEVER activate a slave within MX_MIN_SLAVE_DELAY seconds of
another.
# The default of zero means that the multiplexor will activate slaves as
# quickly as necessary to keep up with incoming mail.
MX_MIN_SLAVE_DELAY=1

# Set to yes if you want the multiplexor to log stats in
# /var/log/mimedefang/stats  The /var/log/mimedefang directory must
# exist and be writable by the user you're running MIMEDefang as.
# MX_STATS=no

# Set to yes if you want the stats file flushed after each entry
# MX_FLUSH_STATS=no

# Set to yes if you want the multiplexor to log stats to syslog
# MX_STATS_SYSLOG=no

# The socket used by the multiplexor
MX_SOCKET=$SPOOLDIR/mimedefang-multiplexor.sock

# Maximum # of requests a process handles
MX_REQUESTS=200

# Minimum number of processes to keep.  The default of 0 is probably
# too low; we suggest 2 instead.
MX_MINIMUM=3

# Maximum number of processes to run (mail received while this many
# processes are running is rejected with a temporary failure, so be
# wary of how many emails you receive at a time).  This applies only
# if you DO use the multiplexor.  The default value of 2 is probably
# too low; we suggest 10 instead
MX_MAXIMUM=10

# Uncomment to log slave status; it will be logged every
# MX_LOG_SLAVE_STATUS_INTERVAL seconds
# MX_LOG_SLAVE_STATUS_INTERVAL=30

# Limit slave processes' resident-set size to this many kilobytes.
Default
# is unlimited.
# MX_MAX_RSS=10000

# Limit total size of slave processes' memory space to this many
kilobytes.
# Default is unlimited.
# MX_MAX_AS=30000

# Number of seconds a process should be idle before checking for
# minimum number and killed
MX_IDLE=300

# Number of seconds a process is allowed to scan an email before it is
# considered dead.  The default is 30 seconds; we suggest 600.
MX_BUSY=600

# Extra sendmail macros to pass.  Actually, you can add any extra
# mimedefang options here...
# MD_EXTRA="-a auth_author"

# Multiplexor queue size -- default is 0 (no queueing)
MX_QUEUE_SIZE=10

# Multiplexor queue timeout -- default is 30 seconds
MX_QUEUE_TIMEOUT=30

# SUBFILTER specifies which filter rules file to use
SUBFILTER=/etc/mail/mimedefang-filter


# Source configuration
if [ -f /etc/mail/$prog.conf ] ; then
    . /etc/mail/$prog.conf
fi

# Make sure required vars are set
SOCKET=${SOCKET:=$SPOOLDIR/$prog.sock}
MX_SOCKET=${MX_SOCKET:=$SPOOLDIR/$prog-multiplexor.sock}

start_it() {
    if test -r $PID ; then
	if kill -0 `cat $PID` > /dev/null 2>&1 ; then
	    echo "mimedefang (`cat $PID`) seems to be running."
	    return 1
	fi
    fi
    if test -r $MXPID ; then
	if kill -0 `cat $MXPID` > /dev/null 2>&1 ; then
	    echo "mimedefang-multiplexor (`cat $MXPID`) seems to be
running."
	    return 1
	fi
    fi

    printf "%-60s" "Starting $prog-multiplexor: "
    rm -f $MX_SOCKET > /dev/null 2>&1
    $PROGDIR/$prog-multiplexor -p $MXPID \
	`[ -n "$FILTER" ] && echo "-f $FILTER"` \
	`[ -n "$SYSLOG_FACILITY" ] && echo "-S $SYSLOG_FACILITY"` \
	`[ -n "$SUBFILTER" ] && echo "-F $SUBFILTER"` \
	`[ -n "$MX_MINIMUM" ] && echo "-m $MX_MINIMUM"` \
	`[ -n "$MX_MAXIMUM" ] && echo "-x $MX_MAXIMUM"` \
	`[ -n "$MX_LOG_SLAVE_STATUS_INTERVAL" ] && echo "-L
$MX_LOG_SLAVE_STATUS_INTERVAL"` \
	`[ -n "$MX_USER" ] && echo "-U $MX_USER"` \
	`[ -n "$MX_IDLE" ] && echo "-i $MX_IDLE"` \
	`[ -n "$MX_BUSY" ] && echo "-b $MX_BUSY"` \
	`[ -n "$MX_REQUESTS" ] && echo "-r $MX_REQUESTS"` \
	`[ -n "$MX_SLAVE_DELAY" ] && echo "-w $MX_SLAVE_DELAY"` \
	`[ -n "$MX_MIN_SLAVE_DELAY" ] && echo "-W $MX_MIN_SLAVE_DELAY"` \
	`[ -n "$MX_MAX_RSS" ] && echo "-R $MX_MAX_RSS"` \
	`[ -n "$MX_MAX_AS" ] && echo "-M $MX_MAX_AS"` \
	`[ "$MX_LOG" = "yes" ] && echo "-l"` \
	`[ "$MX_STATS" = "yes" ] && echo "-t /var/log/mimedefang/stats"` \
	`[ "$MX_STATS" = "yes" -a "$MX_FLUSH_STATS" = "yes" ] && echo
"-u"` \
	`[ "$MX_STATS_SYSLOG" = "yes" ] && echo "-T"` \
	`[ -n "$MX_QUEUE_SIZE" ] && echo "-q $MX_QUEUE_SIZE"` \
	`[ -n "$MX_QUEUE_TIMEOUT" ] && echo "-Q $MX_QUEUE_TIMEOUT"` \
	-s $MX_SOCKET
    RETVAL=$?
    if [ $RETVAL = 0 ] ; then
	echo "[  OK  ]"
    else
	echo "[FAILED]"
	return 1
    fi

    # Start mimedefang
    printf "%-60s" "Starting $prog: "
    rm -f $SOCKET > /dev/null 2>&1
    $PROGDIR/$prog -P $PID \
	-m $MX_SOCKET \
	`[ -n "$MX_USER" ] && echo "-U $MX_USER"` \
	`[ -n "$SYSLOG_FACILITY" ] && echo "-S $SYSLOG_FACILITY"` \
	`[ "$MX_RELAY_CHECK" = "yes" ] && echo "-r"` \
	`[ "$MX_SENDER_CHECK" = "yes" ] && echo "-s"` \
	`[ "$MX_RECIPIENT_CHECK" = "yes" ] && echo "-t"` \
	`[ "$KEEP_FAILED_DIRECTORIES" = "yes" ] && echo "-k"` \
	`[ "$MD_EXTRA" != "" ] && echo $MD_EXTRA` \
	-p $SOCKET
    RETVAL=$?
    if [ $RETVAL = 0 ] ; then
	echo "[  OK  ]"
    else
	echo "[FAILED]"
	kill `cat $MXPID`
	return 1
    fi
    return 0
}

stop_it() {
    # Stop daemon
    printf "%-60s" "Shutting down $prog: "
    if test -f "$PID" ; then
	kill `cat $PID`
	RETVAL=$?
    else
	RETVAL=1
    fi
    if [ $RETVAL = 0 ] ; then
	echo "[  OK  ]"
    else
	echo "[FAILED]"
    fi

    rm -f $SOCKET > /dev/null 2>&1
    rm -f $PID > /dev/null 2>&1

    # Stop daemon
    printf "%-60s" "Shutting down $prog-multiplexor: "
    if test -f "$MXPID" ; then
	kill `cat $MXPID`
	RETVAL=$?
    else
	RETVAL=1
    fi
    if [ $RETVAL = 0 ] ; then
	echo "[  OK  ]"
    else
	echo "[FAILED]"
    fi

    rm -f $MX_SOCKET > /dev/null 2>&1
    rm -f $MXPID > /dev/null 2>&1
}

# See how we were called.
case "$1" in
  start)
  start_it
    ;;

  stop)
  stop_it
    ;;

  restart)
    stop_it
    start_it
    RETVAL=$?
    ;;

  reread|reload)
    if [ -r $MXPID ] ; then
	kill -INT `cat $MXPID`
	RETVAL=$?
	if [ $RETVAL = 0 ] ; then
	    echo "Told $prog-multiplexor to force reread of filter rules."
	else
	    echo "Could not signal $prog-multiplexor"
	fi
    else
	RETVAL=1
	echo "Could not find process-ID of $prog-multiplexor"
    fi
    ;;

  *)
    echo "Usage: $0 {start|stop|restart|reread|reload}"
    exit 1
esac

exit $RETVAL

Any help would be appreciated.  It keeps screwing up my mail server
because their mail server keeps sending the message.


I thought I fixed this problem by putting a longer delay in the child
spawning but it didn't help at all.



#!/usr/bin/perl
$l="\"Upnfujnft K xjti K dpvm";
$m="e qvu bo fyqjsbujpo ebuf ";
$n="po nz rvpuft.\" || Nbssz ";
$o="Ybmm";	$p="$l$m$n$o";
$p=~y/[b-z][B-Z]/[a-z][A-Z]/   ;
($a, $b)	=	split(/\|\|/, $p);
print "$a\n\t\t\t\t\t- $b\n\n";




More information about the MIMEDefang mailing list