Mail system tweaks HOWTO for sme server

Release supported: sme 6.0, 6.0.1

Author: Ray Mitchell - mitchellcpa_AT_yahoo.com.au

Updated: 3 May 2005 v1

Problem:

Your sme server slows down & even stops due to heavy mail loads and you want to control how many messages are being processed at the same time.

You also have Clamav & Spamassassin operating and these also slow down & stop your server due to heavy mail loads and you want to control how many messages are being processed at the same time.

 

Other problems:

Reject spam using RBL blocking. This is the feature that Jesper Knudsen uses in his Spam Filter contrib.

http://www.contribs.org/contribs/rmitchell/smeserver/howto/Spam%20blocking%20HOWTO%20using%20smtpfront-qmail%20for%20sme%20server.htm

Reject virus infected messages using pattern matching blocking.

http://www.contribs.org/contribs/rmitchell/smeserver/howto/Virus%20and%20file%20blocking%20HOWTO%20using%20smtpfront-qmail%20for%20sme%20server.htm

Reject messages with bad HELO/EHLO entries.

http://lists.contribs.org/mailman/public/devinfo/msg07904.html

Control doublebounce messages see

http://www.contribs.org/contribs/rmitchell/smeserver/howto/double%20bounce%20message%20deletion%20HOWTO%20for%20sme%20server.htm

Manage email aliases for virtual domains see

http://www.contribs.org/contribs/rmitchell/smeserver/howto/virtual%20domain%20email%20aliases%20HOWTO%20for%20sme%20server.htm

Control mail to multiple virtual domains & invalid addresses & configure mail blocking rules see

http://www.dungog.net/sme/files/index.php
dungog-mailblocking-1.0-4.noarch.rpm

Control spam using greylisting. Opinions vary as to the effectiveness of using this.

http://lists.contribs.org/mailman/public/devinfo/msg07912.html

Some of the above have been incorporated into sme 6.5 & 7.0

 

Solution:

Make the adjustments outlined in this HOWTO & install the above mentioned rpms or edit configuration by following the HOWTOs or instructions as available.

 

Thanks:

This HOWTO is based on forum posts, emails and my own investigations, thanks particularly to Gordon Rowell, Charlie Brady & Anthony (meanlocha) and to the creators of the various contribs, features and HOWTOs. I have just collated the information into one location and tidied up & clarified the original instructions.

 

 

Qmail ConcurrencyLocal & ConcurrencyRemote settings

These will affect the number of messages that are processed concurrently by qmail (ie from qmail) for messages to & from local addresses and for messages to & from remote (external) addresses.

The settings suggested below are OK for a slow connection (and/or a slow server), you can experiment with them to find what suits your situation the best.

Note that if you have a fast connection & a fast server with a heavy mail load, you may wish to increase the values to speed up mail delivery.

The default values are:

ConcurrencyLocal 20

ConcurrencyRemote 10

 

/sbin/e-smith/db configuration setprop qmail ConcurrencyLocal 5

/sbin/e-smith/signal-event email-update

/etc/init.d/qmail restart

 

/sbin/e-smith/db configuration setprop qmail ConcurrencyRemote 3

/sbin/e-smith/signal-event email-update

/etc/init.d/qmail restart

 

To check the settings do:

/sbin/e-smith/config show qmail

qmail=service

ConcurrencyLocal=5

ConcurrencyRemote=3

status=enabled

 

smtpfront-qmail concurrent processes setting

This will affect the number of concurrent smtpfront-qmail processes (ie messages from smtpfront-qmail into qmail).

The setting suggested below is OK for a slow server, you can experiment with it to find what suits your situation the best.

This setting is not currently controlled by a database entry, but by creating a custom template fragment.

mkdir -p /etc/e-smith/templates-custom/var/service/smtpfront-qmail/runenv

cd /etc/e-smith/templates-custom/var/service/smtpfront-qmail/runenv

pico Concurrency

add following details

CONCURRENCYREMOTE=4

Alt C to save, alt X to exit

/sbin/e-smith/signal-event email-update

 

 

Spamassassin processes setting

If you have Spamassassin (& Clamav) running these can consume quite a lot of resources on your server. Spamassassin is particularly processor and memory intensive and can cause minimum configuration servers to stop, with even moderate amounts of mail.

To configure Spamassassin daemon to process only two email messages at a time do the following, keeping in mind that this will severely limit email throughput:

Change (edit) /etc/sysconfig/spamassassin to contain the following and restart spamassassin:

pico /etc/sysconfig/spamassassin

add following details

SPAMDOPTIONS="-d -m2"

Alt C to save, alt X to exit

/etc/init.d/spamassassin restart