Sendmail Queuing Time Setting

Moderator: cah

Post Reply
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Sendmail Queuing Time Setting

Post by cah »

Since the queuing and retrying of sending email from sendmail is causing the ADSL slowness, I decide to change back the queuing time from 5 minutes back to 15 minutes.

From:

Code: Select all

/usr/lib/sendmail -Ac -q5m
To:

Code: Select all

/usr/lib/sendmail -Ac -q15m
In order to do so, the following line in /lib/svc/method/smtp-sendmail has to be changed:

Code: Select all

check_queue_interval_syntax()
{
        default="5m"
        if [ $# -lt 1 ]; then
                answer=$default
                return
        fi
        if echo $1 | egrep '^([0-9]*[1-9][0-9]*[smhdw])+$' >/dev/null 2>&1; then
                answer=$1
        else
                answer=$default
        fi
}
default="5m" needs to be changed to default="15m"

After the change, sendmail needs to be stopped first:

Code: Select all

/etc/init.d/sendmail stop
Wait until spawn processes also disappeared, then restart:

Code: Select all

/etc/init.d/sendmail start
The following lines can be seen in /var/log/syslog:

Code: Select all

Jul  7 20:19:43 solaris sendmail[19734]: [ID 702911 mail.info] starting daemon (8.14.4): SMTP+queueing@00:15:00
Jul  7 20:19:43 solaris sendmail[19737]: [ID 702911 mail.info] starting daemon (8.14.4): queueing@00:15:00
The new processes have 15-minute queuing time now:

Code: Select all

    root 19734     1   0 20:19:43 ?           0:00 /usr/lib/sendmail -bd -q15m
    root 19735 19734   0 20:19:43 ?           0:01 /usr/lib/sendmail -bd -q15m
   smmsp 19737     1   0 20:19:43 ?           0:00 /usr/lib/sendmail -Ac -q15m
CAH, The Great
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Sendmail Queuing Time Setting

Post by cah »

The above queuing time setting is from command line.

sendmail.cf has a bunch of timeout settings including Queue Return and Queue Warn:

Code: Select all

#O Timeout.initial=5m
O Timeout.connect=1m
#O Timeout.aconnect=0s
#O Timeout.iconnect=5m
#O Timeout.helo=5m
#O Timeout.mail=10m
#O Timeout.rcpt=1h
#O Timeout.datainit=5m
#O Timeout.datablock=1h
#O Timeout.datafinal=1h
#O Timeout.rset=5m
#O Timeout.quit=2m
#O Timeout.misc=2m
#O Timeout.command=1h
#O Timeout.ident=5s
#O Timeout.fileopen=60s
#O Timeout.control=2m
O Timeout.queuereturn=5d
#O Timeout.queuereturn.normal=5d
#O Timeout.queuereturn.urgent=2d
#O Timeout.queuereturn.non-urgent=7d
#O Timeout.queuereturn.dsn=5d
O Timeout.queuewarn=4h
#O Timeout.queuewarn.normal=4h
#O Timeout.queuewarn.urgent=1h
#O Timeout.queuewarn.non-urgent=12h
#O Timeout.queuewarn.dsn=4h
#O Timeout.hoststatus=30m
#O Timeout.resolver.retrans=5s
#O Timeout.resolver.retrans.first=5s
#O Timeout.resolver.retrans.normal=5s
#O Timeout.resolver.retry=4
#O Timeout.resolver.retry.first=4
#O Timeout.resolver.retry.normal=4
#O Timeout.lhlo=2m
#O Timeout.auth=10m
#O Timeout.starttls=1h
There are only 3 defined default values:

Code: Select all

O Timeout.connect=1m
O Timeout.queuereturn=5d
O Timeout.queuewarn=4h
They are very obvious from the variables. For details, please refer to the following URL:

Tweaking Configuration Options
http://www.sendmail.org/m4/tweaking_config.html

Due to sendmail drags down the whole network, I am considering lowering the queuereturn timeout setting.

I am still trying to find out why a failed sendmail delivery process could bring down the whole network. It simply does not make any sense!
CAH, The Great
Post Reply