[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sendmail & Queuing





Jason McMullen wrote:
Good Day All,

I'm running into an odd issue.  We have 2 servers that act as
"front-end" MX hosts running Sendmail.  These servers then smarthost all
mail back to a main server.  This works well at keeping the main server
unloaded due to dictionary attacks and whatnot.  The problem we're
seeing is the MX hosts bogging down when trying to deliver mail to the
main host.
Does anyone have any tried and true methods for getting Sendmail to be a
little "nicer" about its queuing strategy?  Or is the best option qmail
or another MTA?

TIA!

-Jason



You might want to experiment with connection caching, so that the MX servers don't open a new connection to the mail_hub. Something like:
define(`confMCI_CACHE_SIZE',`2')dnl
define(`confMCI_CACHE_TIMEOUT',`120s')dnl

Also may want to sort your queue by host, so that all internal mail gets delivered in order.

How many messages do you have in the queue on your MX hosts? If you're pushing over 1000, I'd suggest splitting into multiple queue directories.

Do you have host status enabled? If so, your state directory may be the problem (.com and .net directories may have thousands of entries, which was not good on my ext2 filesystem). I have had good luck with making a small ReiserFS parition for /var/local/state/sendmail.

How are you handling dictionary attacks? just letting the MX'es handle trying to DNS notifies, or do your MX hosts know about valid usernames?

If you have lots of bounces sitting in your queue on your MX hosts due to spammer dictionary attacks, you can move the DSN messages into a "slow running" queue. Debian's sendmail installation has a method to do this, or you can do something like:

a) Create a new queue directory (/var/spool/mqueue-slow-retry in my case).

b) Create the following /etc/cron.d/sendmail_slowqueue entry (may need to correct line breaks):

#!/bin/sh
#
# sendmail_slowqueue -- move hanging messages into a slower queue...
#
# 11/12/2003 by rpuhek@etnsystems.com
#

# Every 8 min, move to slower queue...
# (every 8, so that we stagger away from regular queue run... trying
# to prevent getting blocked by queue run.
*/8 * * * * root /usr/share/sendmail/qtool.pl -e '$msg{num_delivery_attempts} >= 3 && ($msg{sender} =~ "\<\>" or $msg{sender} =~ "MAILER-DAEMON")' /var/spool/mqueue-slow-retry /var/spool/mqueue/Q*

#Process the slow queue every 3 hours, instead of default 20 minutes.
# 11/17/03: Changed to run as root (permission problem as smmsp),
# also added QueueSortOrder=host, since most will be undeliverable
# bounce messages anyway. --RAP
5 */3 * * * root /usr/sbin/sendmail -q -L sendmail-slowqueue -O QueueDirectory=/var/spool/mqueue-slow-retry -O QueueSortOrder=host


--Rich




Reply to: