Having recently added an influx of hosting customers and some additional SA rules, I noticed a considerable increase in the amount of load that MailScanner was creating, with a limited spend this year (Too many shiny new servers) I decided to investigate improving MailScanners efficiency.

After some research, I decided to add RBL's and drop connections at SMTP time - that killed off a lot of unwanted mail traffic

The second thing to do was to set up MailScanners work directory as a ramdisk - You wouldn't believe the load decrease!

Heres How You Do It:

vi /etc/fstab

Then add this line to it:

none /var/mstmp tmpfs size=64m 0 0

You may want to tweak the size of the ramdisk, mailscanner state that it shouldnt use more than 64MB at any given time but I know people running more than that (Some up to 100MB) this will have to be trial and error.

Now Mount the RAMDisk

mount /var/mstmp

Check now that it actually mounted

df -h

Now tell MailScanner to use the new ramdisk as its working directory. If you use the WHM front-end from configserver, click on the MailScanner Configuration button.

If you installed it via the configserver install script (Which nearly all cPanel servers are) it is located at: /usr/mailscanner/etc/MailScanner.conf

In your MailScanner configuration file, find the line that begins:

Incoming Work Dir =

Set that to the path of the ramdisk you just created, for example:

Incoming Work Dir = /var/mstmp

Then save the config file, and restart mailscanner, Job done!