[ILUG] Sendmail: max delivery of mails
Paul Jakma
paulj at itg.ie
Wed Mar 7 18:55:19 GMT 2001
On Wed, 7 Mar 2001, Donncha O Caoimh wrote:
> I'd like to limit the number of concurrent Sendmail processes delivering
> mail from our server because it soaks our ISDN connection.
use Donncha's install-sendmail script... oh wait.. :)
>
> Uising Sendmail 8.9.2 still, and would rather some hints on modifying
> sendmail.cf as I don't want to try and find the m4 file again..
> I've tried setting "QueueLA" to 4 instead of 8 which might encourage
> Sendmail to queue messages instead of delivering them..
> "When the system load average exceeds LA, just queue messages (that is,
> do not try to send them). Defaults to 8."
whips out bat book...
sendmail doesn't seem to have explicit outbound throttling (i cant
find it). what you could do is enable single threaded per remote MTA
delivery with:
confMCI_CACHE_SIZE(`4')
confHOST_STATUS_DIRECTORY(`/path/to/status/cache/dir')
and
confSINGLE_THREAD_DELIVERY(`true')
this will stop sendmail open multiple connections to the same remote
MTA, and instead if there's mutliple mails it will feed it one by one
to that MTA over the same connection.
This isn't a recc'd configuration for the daemon though. From bat
book: it means a large email to acme.com will cause other smaller
messages to acme.com to be queued until that large message has been
delivered. If that is acceptable then this would be a way to reduce
sendmails bandwidth consumption to a degree.
MCI_CACHE and HOST_STATUS_... are good though, but don't solve your
problem.
> Is there a better way? "QueueFactor" looks promising but not sure what
> it does..
if above doesn't help, then you'll need to investigate running the
sendmail listener in queueonly mode, and running a seperate queue
processing job every couple of min from cron to process the queue.
Then you can tweak the work factor to penalise large messages, and
also sort the queue by priority first, eg:
confDELIVERYMODE(`queueonly')
confSEPERATEPROC(`false')
You can then tweak things like ClassFactor and RecipientFactor to
vary the priority penalty for things like class of mail and number of
recipients - if you reduce them then you bias the priority to be more
against the size of the mail. You could even move very large jobs
to another queue for processing at night.
kevins ConnectionRateThrottle suggestion is useful too, but again
aimed more at avoiding high host load. If you set it too low, then
your users will start finding that their client often times out trying
to send email. Some clients in particular will give the user a very
cryptic/confusing message (eg outlook).
basically, i don't think you can do something that is in any way
equivalent to limiting sendmail to x kB/s.
finally it might be possible to use 2.4 either as the host or as a
router in front of the host and use netfilter/iproute/tc to limit the
bandwidth of mail. iptables to mark dst port = smtp packets, and tc to
shape it. have a look at adv-routing howto and probably you'd need to
ask on dedicated mailling lists.
> Donncha.
>
>
regards,
--paulj
More information about the ILUG
mailing list