QMAIL + VPOPMAIL (with MySQL accounts) + COURIER-IMAP + Roundcube, QMAIL-SCANNER + CLAM ANTIVIRUS + SPAMASSASSIN

I have get the permission to copy paste this great guide and keep it updated. The Guide will soon come in a updated version on this homepage.

Link to the Original is online here: http://www.bowe.id.au/michael/isp/webmail-server.htm

INSTALL UCSPI-TCP

INSTALL DAEMONTOOLS

INSTALL QMAIL
Download the required files

Unzip the sources, apply the required patches, compile

Edit qmail-smtpd.c and change the code on the straynewline function (around line 54) from 451 to 553
Without this you will get nasty loops forming when a remote servers sends you an message with invalid formatting. By default qmail will says something like  “I am not going to accept that message at the moment, you can try again later”. However in my experience the sending server will try sending the same message again a few seconds later, and this will go around and around in a loop for days on end – consuming valuable bandwidth and resources. By changing the error code to 553, it is making the error be permanent ie “I am not going to accept that message, don’t try sending it again”

Remove the sendmail package, and link in qmail’s replacement utility

The qmailctl script contains all the various commands that will allow us to control our qmail daemons. Put it in with the other qmail binaries. Also link it into /usr/bin so it will be in our “path” for easy access


Setup the /etc/tcp.smtp file
This file controls who is allowed to send and/or relay mail on this server
An example configuration follows :

Setup the /etc/tcp.pop3  file
This file controls who is allowed to access the POP3 services on this server
An example configuration follows :

Now we have created our tcp.smtp and tcp.pop3 files, we need to compile them into the cdb database format that the tcpserver program can read

Adjust various aspects of the qmail configuration to suite our tastes :


Create / configure the various qmail run scripts :


cd /var/qmail/supervise/qmail-smtpd
wget http://qmail.jms1.net/scripts/service-qmail-smtpd-run
mv service-qmail-smtpd-run run

Change run script so it fits yours setup

vi run





At this point the qmail daemons should be running. A good way to verify this is to use this command :

If all is well, you should be able to see something like this :

Note the 3 qmail daemons : qmail-send, qmail-smtpd, qmail-pop3d, as well as their associated logging processes. If there is anything wrong with your install, an error message will generally be visible on the “readproctitle” line

You can control the qmail daemons by using the qmailctl program. You can just type that command without any parameters and it will display the available options eg start, stop, status, doqueue


VPOPMAIL

https://sourceforge.net/projects/vpopmail

Make the user accounts





Download and unpack the source

Setup the MySQL support in the vpopmail sources






Now, build the program

Notes :
The   “–enable-mysql-limits” configuration option is fairly new. I plan to update my guide to use this function at some point in the near future once I have done some testing etc of this functionality

I used to recommend the –disable-many-domains switch – which tells vpopmail to create one MySQL table per email domain. When I first started building vpopmail servers, I found this to be the most logical way, having each domain in its own table. However there has been some discussion about this config option on the vpopmail mailing lists, and it sound like this option may be removed at some point in the future.  If you have a lot of domains on your server, having each domain in its own table can hurt performance. I now agree that –enable-many-domains (which is the default) is probably the better choice

Review the contents of the file is used to set the default limits for any domains / mailboxes in the vpopmail system. Make sure it contains reasonable defaults for your system.

Optionally, nominate a “default domain”. Users in this domain can login to POP3 etc using just their username. Users from all other domains need to use their full email address as their login name.

Setup the quota warning message that is sent to users when they are at 90% quota

If you want, you can alter the standard message that gets sent to the sender in an overquota situation

OK, vpopmail is now installed!

Some example vpopmail commands :
To add a domain :

To add a mailbox:


(Or you can do it via qmailadmin)

To remove a mailbox


(Or you can do it via qmailadmin)

To remove a domain :

To change a user’s password


(Or you can do it via qmailadmin)

To lookup info about a user


This gives you info such as name, crypted password, cleartext password, dir, quota, usage%, last auth.
It has a number of flags to let you see the individual fields, or you can see them all if you dont use any flags.

It also creates the maildirsize file in the users dir

Logging in via POP3
When your users are setting up their POP3 email clients (eg Outlook Express), they should use settings like this :
My incoming mail server is a POP3 server
Incoming mail server (POP3): pop3.yourdomain.com
Outgoing mail server (SMTP): smtp.yourdomain.com
POP3 account name : theirusername@yourdomain.com
Password: theirpassword

When you configured vpopmail, you had the opportunity to nominate a “default” domain. When users from the default domain authenticate, it is optional for them to add the @yourdomain.com onto the end of their username. If vpopmail sees that no domain has been specified by the user, then it will automatically perform the auth against the nominated default domain. If you are hosting multiple domains, then everyone who is NOT in the default domain MUST add their domain name onto the end of their username. (A small percentage of email programs eg Netscape Mail v4.7 do not permit the use of the @ symbol in account name. In this case you can use the % symbol instead of the @ symbol)

vpopmail roaming users :
With qmail, the typical way to control mail relaying is to put a list of rules into a file called tcp.smtp. The tcprules program is then used to compile this file into cdb database format with the output being stored in a file called tcp.smtp.cdb. The tcpserver program is configured (using the -x parameter) to read this file and thus know which SMTP clients are permitted to relay mail.

This type of configuration works well if there is a known range of IP addresses that are permitted to relay mail. eg the IP’s on the qmail server’s local LAN. However if the qmail server needs to provide outbound SMTP services for clients who may be connecting from any IP, you are going to run into problems. What is needed is some way to automate the process of granting users the ability to relay mail, without opening up access to all and sundry on the Internet.

vpopmail includes a solution for this problem. The solution is known as “roaming users” and is typically implemented with a technique known as “POP-before-SMTP”. Once a client has successfully authenticated via POP3, vpopmail will add the client’s IP to a list. vpopmail then merges this list with the contents of the tcp.smtp file and runs the tcprules program to compile a new version of the tcp.smtp.cdb file. Thus the client can now relay mail.

In addition to storing the client’s IP address, vpopmail will also store the time of authentication. The postmaster uses a cronjob on the qmail server to periodically (eg once per hour) run the clearopensmtp program. This program scans through the list of roaming clients and removes any entries that exceed the nominated age (eg 3 hours). This ensures that the list of IPs does not grow out of bounds, and that the roaming IPs are closed within a reasonable timeframe after being opened.

configure options for vpopmail that relate to roaming users :

Example /var/qmail/supervise/qmail-smtpd/run file :

Notes :

qmail servers are typically built with the tcp.smtp files being located in the /etc directory. This is not usually suitable for vpopmail roaming users, since the /etc directory will (should) not have write permissions for the vpopmail user. Therefore it is not going to be possible for vpopmail to write out updated versions of the tcp.smtp.cdb file. For use with roaming users, it is recommended that the tcp.smtp files are stored in ~vpopmail/etc

If a user auths, and their IP already exists in the roaming IP list, the timestamp for the entry is updated, but the tcprules program is not run. There is no need to rebuild the tcp.smtp.cdb file as the IP address is already permitted to relay. Rebuilding the file will only waste disk and CPU time.

If the vpopmail server is using the default cdb authentication backend, then the list of roaming IPs will be stored in a file called ~vpopmail/etc/open-smtp. If the vpopmail server is using the MySQL backend, the roaming IPs will be stored in a database table called relay. The SQL backend will give better performance on a busy server. Either way though, you should be cautious about enabling roaming user functionality on a very busy server, as a large amount of disk and CPU will be used with the continual rebuilding of the tcp.smtp.cdb file. If the server is busy enough you could run into nasty file locking issues which will cause vpopmail password authentication to intermittently fail. If you absolutely must have POP-before-SMTP functionality on your busy server, then there are only two possible solutions that I can think of  : 1) you could try putting the tcp.smtp files onto a RAM disk, or 2) use vpopmail’s MySQL auth backend plus use Matt Simerson’s tcpserver patch that allows all of the tcp.smtp files to be stored in MySQL

For POP-before-SMTP to work, the POP3 daemon will need to run under the tcpserver program. This is because vpopmail uses tcpserver’s TCPREMOTEIP environment variable to work out what IP address the POP3 user is connecting from.

Over time POP-before-SMTP is becoming a less favored way of allowing roaming users to relay mail. SMTP-Auth appears to becoming the more preferred option, as it scales much more easily on a busy server. However for a small to medium sized server, POP-before-SMTP is still quite a workable option. If you would like investigate the use of SMTP-Auth take a look at this patch http://www.fehcom.de/qmail/smtpauth.html#PATCHES

IMAP-before-SMTP is possible when using Courier-IMAP v3.x. However it only works when configured “–with-authvchkpw –without-authdaemon”. When running –without-authdaemon, Courier-IMAP’s authvchkpw code is able to make use of vpopmail’s roaming user functions to allow IMAP-before-SMTP functionality. IMAP-before-SMTP is not possible when Courier-IMAP has been complied –with-authdaemon, because in this mode the user’s IP address is not made available to the authvchkpw code (via the TCPREMOTEIP env var). Also note that in Courier-IMAP v4.x and later, –without-authdaemon functionality is no longer available thus preventing IMAP-before-SMTP from working.


AUTORESPONDER

Current development location : http://www.sourceforge.net/projects/qmailadmin

This package is a prerequisite for qmailadmin.

Download and unpack the source

Build the program

Notes :

Qmailadmin uses the autorespond program for both autoresponse (“mail robot” in qmailadmin-speak), and vacation response duties. However this is pretty badly FUBAR. Reason being is the autorespond.c is written to do duties as an autoresponse program only. “Out of the box” it doesn’t behave correctly when doing vacation response duties. The code inside the program can be easily tweaked to work correctly as a vacation responder, but this will break the autoresponder functionality. Unfortunately the settings are mutually exclusive. In my opinion the correct solution is to create two variations of this program, autorespond.c and vacation.c, install them both, and then tweak qmailadmin to call the right binary for the right job. I have opened a bug report on the qmailadmin sourceforge site to try and get this problem sorted out. If you read back through the qmailadmin and vpopmail archives, you will see the the autoresponder stuff is an ongoing saga 🙁

ps. Inter7 have got a modified version of the autorespond program, which I believe has been coded to work correctly as a vacation responder http://inter7.com/devel/autorespond-2.0.5.tar.gz

EZMLM / EZMLM-IDX

This package is a prerequisite for qmailadmin

ezmlm is mailing list software written by the author of qmail
ezmlm-idx is patch that adds extra features to the standard ezmlm program.

EZMLM : http://cr.yp.to/ezmlm.html

EZMLM-IDX PATCH : http://www.ezmlm.org
(although I often find this site unresponsive, and so I use one of the mirrors instead like http://www.glasswings.com.au/ezmlm/)

Download and unpack the ezmlm sources

Merge the sources together

Build the program

QMAILADMIN

Original Authors : http://www.inter7.com/qmailadmin
Current Development location  : https://sourceforge.net/projects/qmailadmin/

Description :

The domain postmaster can use this tool to view all the accounts on the domain as well as add/remove accounts, forwards, auto-responders etc.

Domains users can use this tool to modify their own user settings only. ie mailbox password, real name, forwards, vacations.

This tool does not let you create new domains.

Download and unpack the source

(Optional) Make a small mod that affects the look of the qmailadmin login page

edit the lang/en file, and change record 112 “Username” rather than “User Account”
(We found our users knew what to type as their “Username”, but didn’t know what to type as a “User Account”)

Build the program

Test to see if it works

If you login a domain postmaster, then you should get the screens where you can view all and add/remove mailboxes, aliases, mailinglists etc on the domain. etc

If you login as a user, you can only access your own mailbox settings (eg password, forwards, vacation messages)

Setting limits :

You can setup limits on any domains where required by putting a .qmailadmin-limits file into the domain’s virtual dir (/home/vpopmail/domains/yourdomain.com). Make sure vpopmail user has read permissions for this file.

Syntax of .qmailadmin-limits file is as follows :

Set X to be the maximum desired number for that feature
Set X to be 0 if you want to disable that feature & menu item

There are also some other settings that can be specified in the .qmailadmin-limits file, refer to section 6 of the qmailadmin installation instructions (http://inter7.com/qmailadmin/install.txt) for more info

A bit of a long-winded misc note to myself :

(If you are setting up your vpopmail server for the first time, then this block of text has no relevance to you. You can skip straight past this waffle and go onto the next section…)

As of qmailadmin-1.0.21, you cant create “aliases” any more. What qmailadmin previously created as aliases, are now created as forwards. Aliases dump incoming mail for that aliased address directly into the recipient user’s Maildir. The problem with this is it bypassed any further “.qmail” processing, meaning that you ran into problems if you were trying to setup some of the more fancy things (like per-user SpamAssassin configurations?). Using forwards bypasses this problem as the message will get re-injected back into the queue for delivery.

However this change does cause some problems for sites that already have existing aliases in use. The problem is that when you go into qmailadmin-1.0.21 and select the forwards screen, all the existing aliases and forwards for that domain are displayed.

Problem # 1 : For mail that is being redirected to a local account, you can’t tell from this screen whether the user is getting alias or forward delivery. If you were trying to setup some tricky per-user stuff, then you are going to get variable results because some users may be configured as alias, and others are configured as forward, but you cant easily tell which is which from this screen

Problem # 2 : Up the top there is a count showing “[Used # / limit]”. This count relates to the number of forwards in use and the maxforwards qmailadmin-limits setting. The count ignores any existing aliases. This could potentially cause confusion for domain postmasters as you will be looking at a screen full of accounts and if some of them have been previously setup as aliases then it is going to be hard to reconcile the reported count against the number of accounts displayed on the screen

What is needed is some sort of utility that will scan and find existing aliases and convert them over to the now-preferred forward syntax…. That would keep the delivery method consistent for all users, and would also eliminate any problems with the qmailadmin-limits code

Note: As of qmailadmin-1.0.25, there is a tool for converting existing aliases to forwards. Look in the contrib dir for the tools called alias2forward.pl

valias processing :

qmailadmin v1.2.1 and later store aliases and autoresponders in valias table if vpopmail was compiled with –enable-valias. If you are upgrading from a previous version of QmailAdmin and used the –enable-valias option when building vpopmail, be sure to download vpopmail 5.4.1 or later and use the dotqmail2valias program to convert .qmail-alias files to valias table entries.


COURIER IMAP

http://www.courier-mta.org/imap/

Courier-IMAP is an IMAP server. Having an IMAP server is a prerequisite to be able run a IMAP-client WebMail system like SquirrelMail. Courier-IMAP is good choice because it has support for vpopmail authentication and maildir mailboxes.

Download and unpack the authentication library

Build the authentication library

Review the settings for the authentication library

Configure the authentication library so it is running all the time from bootup onwards

Then I like to use the ntsysv program to double-check that courier-authlib is set to launch at boot time

If you aren’t ready to reboot the server now, you can fire up the authentication libraries in the mean time with this command :

At this point the courier-authlib software should be running. A good way to verify this is to use this command :

And if all is well, you should be able to see something like this :

FAM + Courier-IMAP on Redhat 7.3 doesnt seem very stable. On old Linux platforms, I would recommend you remove FAM before trying to install Courier-IMAP ( By the way, the alternative/replacement package GAMIN seems to works OK with Courier-IMAP on newer platforms like FC4/FC5/CentOS43)

Download and unpack the courier-IMAP source

Build the program

The Courier-IMAP package includes 4 servers that can be individually enabled/disabled : IMAP, IMAP-SSL, POP3, POP3SSL. In this example, we are only using the IMAP server.

Configure Courier-IMAP so it is running all the time from bootup onwards

Then I like to use the ntsysv program to double-check that courier-imap is set to launch at boot time

If you aren’t ready to reboot the server now, you can fire up Courier-IMAP in the mean time with this command :

At this point the Courier-IMAP software should be running. A good way to verify this is to use this command :

And if all is well, you should be able to see something like this :


SQUIRRELMAIL

www.squirrelmail.org

the text with yellow background is specific to using MySQL backend. if you don’t want to use MySQL backend, then just skip over these sections….

Go to the SquirrelMail download page, and save the latest source to /usr/local/src. In this example I have used :

Download and unpack all the sources

Create the required directory structure

SquirrelMail allows you to add your company logo to the login page. So whack a copy of your logo into the Apache images directory so it is available for SquirrelMail to use

Configure SquirrelMail

Create the necessary database and tables in MySQL, so that SquirrelMail can store the address books and user preferences there :

You can define what default SquirrelMail settings that users will receive when they log in.

For MySQL backend

Or, if you aren’t running MySQL backend for SquirrelMail, you can adjust the default preferences like this :

show_html_default=1
language=en_US
use_javascript_addr_book=1
left_size=140
left_refresh=3600
show_username=1
show_username_pos=top
order1=1
order2=2
order3=3
order4=5
order5=4
order6=6

Setup periodic purging of the “attach” directory

When SquirrelMail users are composing a message that has attachment(s), the attachment is temporarily stored in the /var/squirrelmail/attach directory.  When the user sends the message, the associated temp files will get deleted.

However sometimes the temp files do not get deleted (eg if the user closes their browser mid-compose?).  Since the permissions on this directory are setup (as a security measure) to prevent the webserver from listing the files in this directory, there is no way for Apache/SquirrelMail to do a periodic scan/purge of old files.

So we are going to setup a daily crontab to clean up any attachments that get left hanging around

Install the quota_usage plugin so users can see their mailbox quota usage

Optionally, Setup SSL mode at login time

Optionally, modify SquirrelMail so that it will any failed login attempts to the syslog

modify squirrelmail/functions/imap_general.php

search for the line that has “Unknown user or password incorrect”
above this line add :

now failed SquirrelMail logins will be logged to /var/log/maillog  🙂

We also added some code to squirrelmail/src/login.php to add a notes page to the login screen. We inserted this chunk just before the line that says “do_hook(‘login_bottom’);

Now, another cosmetic change… : modify the squirrelmail/src/login.php and change the wording of “Name:” to “Email address:”.

Next, we setup a default document in the web servers root, to redirect our customers through to the SquirrelMail login page. That way when people want to access the WebMail tool they can point their browser to “http://webmail.yourdomain.com” and they will get automatically redirected through to the SquirrelMail directory


SPAM AND VIRUS CHECKING

OK, now you have a working mail server.. You have loaded all your users and they are giving the new system a good workout. Everything is running nice and smoothly. You sit back and think “my job is done!”

Until… users starting coming to you and saying… “Hey, this new mail server is really good… But how do I block out all these viruses and spam?”… Uh oh…!

Well, luckily the answer is relatively easy….. The qmail-scanner program lets us easily implement anti-spam and anti-virus. Installation instructions follow :

OPTIONAL : RAZOR V2

http://razor.sourceforge.net

If Razor is installed, SpamAssassin will automatically include it in the list of tests run. We found that Razor is quite accurate in identifying spam, and it only added small amount of extra CPU load on the server, so it is definitely worth installing. Note though, that I believe the licensing of Razor states that it isn’t free for commercial use – so you should probably check the docs before deciding whether you wish to enable this function or not

Compile and install :

The Razor programs will now be installed in /usr/bin. In particular, SpamAssassin makes use of the program called : “razor-check”

Last job is to create the Razor configuration files (they get put into /etc/razor/) by using these commands :

If your server is going to be busy, then I would recommend you edit the razor config file and turn down the debugging level a bit :

SPAMASSASSIN

http://www.spamassassin.org

Description :

SpamAssassin is program that scans email messages using a set of rules, and then assigns a score. If the score is higher than your nominated limit, then the message will be tagged as spam.

Download and compile

“make install” creates the following main files :

Test to see if the installation was successful. (Watch the output from the script. SpamAssassin will add headers to the message. In particular look for the “X-Spam-Status: ” and see if it correctly tags the message with a Yes or No)

To improve security, modify the configuration of the spamd daemon so it runs under its own uid

Create a spamd user for the spamd process to run as

Modify / create the spamd configuration file

Configure the spamd daemon so it is running all the time from bootup onwards

Then I like to use the ntsysv program to double-check that spamd is set to launch at boot time

Setup the SpamAssassin configuration

Just to make sure the bayes database directory will be setup correctly :

If you wish to view all the possible configuration options, use this command :

Enable the razor functions

OK, the SpamAssassin software is now fully installed!

Any mail that SpamAssassin classifies as spam will have [SPAM] added to the subject line.  You should now probably setup some docs for your users showing them how they can use message filtering rules in their email client. You can see our message filtering guides here

If you aren’t ready to reboot the server now, you can fire up spamd in the mean time with this command :

If all goes well you will see some output like this :

(Note that spam filtering isn’t actually operational on your server yet, you need to use the qmail-scanner program to feed mail through the SpamAssassin scripts)

CLAM ANTI-VIRUS

http://www.clamav.net

Clam antivirus can run in two different modes. Either as a normal command line scanner, or as a client/daemon pair.

When working as a command line scanner, you perform your scanning using the program “clamscan”. If a complex program like a virus scanner is run repetitively (ie being launched for every email that passes through your system), it chews up a lot of CPU/disk resources. To get around this issue you can launch Clam as a daemon (clamd). This is where a copy of Clam is launched and stays active in the background. You then do your scanning using the clamdscan client, which is only small, thus making it fast to launch/run. The client sends commands to the daemon, and the daemon will take care of scanning the message and returning the results to the client. (The same technique is used by SpamAssassin where you can use the full spamassassin command line version, or the spamc/spamd client/daemon pair).

In a busy environment, there is no doubt that the client/daemon method is the best way to go

Customise the clamd configuration file

Configure clamd so it is running all the time from bootup onwards

Then I like to use the ntsysv program to double-check that clamd is set to launch at boot time

If you aren’t ready to reboot the server now, you can fire up clamd in the mean time with this command :

At this point the clamd software should be running. A good way to verify this is to use this command :

And if all is well, you should be able to see something like this :

Setup the freshclam configuration file

Configure freshclam to start on boot

Launch freshclam now

At this point the freshclam software should be running. A good way to verify this is to use this command :

And if all is well, you should be able to see something like this :

QMAIL-SCANNER

http://qmail-scanner.sourceforge.net

Description :

Qmail-Scanner is an add-on that enables a qmail server to scan messages for certain characteristics. It is typically used for its anti-virus protection functions, in which case it is used in conjunction with commercial (or open source) virus scanners. It also capable of blocking email that contains specific strings in particular headers, or particular attachment filenames or types (e.g. *.VBS attachments).

Install the required supporting modules for Qmail-Scanner

TNEF unpacker

ReformatMIME (from the Maildrop package)

A “Qmail-Scanner ST patch” has been released by Salvatore Toribio, which greatly extends the functionality of qmail-scanner. The patch adds extra features to help deal with spam (such as dropping messages that exceed a certain SpamAssassin score). We are going to use this patch, as it makes qmail-scanner much more useful.

Now at this point, I would recommend you spend some time reading the qmail-scanner documentation. And once you have read that, take a look at the qmail-scanner-st patch doco

Next, create a user and group for the qmailscanner to run under

For qmailscanner to work correctly with clamav, you need to adjust clamav to run under the qscand username

Configure Qmail-Scanner :

Note : If the install fails with an error like this :

Then you will need to do something like this (this example for Redhat 7.3) :

Edit the perscanner file which is used to block mail that contains particular strings. perlscanner is a tool that is included with qmail-scanner, and it is executed after all the other anti-virus scanners have run (eg clamscan). This system provides a good failsafe in case some new virus comes along that the virus-scanner cant detect yet. perlscanner is perfect for blocking those virus-prone attachments that have no legitimate purpose in email.

Uncomment the following lines :

Any SMTP sessions that are dropped (due to network outages/etc) may lead to files lying around in /var/spool/qmailscan . Running /var/qmail/bin/qmail-scanner-queue.pl -z at least once daily will ensure such files are deleted when they’re over 30 hours old. We will make a cronjob to do that :

Now define what mail is to be sent through the Qmail-Scanner, also make sure that your qmail-smtpd script allocates sufficient resources to support the needs of Qmail-Scanner + Antivirus + SpamAssassin. At our site, we have configured Qmail-Scanner to virusscan all messages (ie inbound and outbound mail). We did this by setting up our our /var/qmail/supervise/qmail-smtpd/run file like this :

Restart the qmail-smtpd service :

However, if you don’t want to virusscan all mail, you can selectively nominate which IP ranges should or shouldn’t be checked by setting the QMAILQUEUE variable via your /etc/tcp.smtp file rather than inside the supervise/qmail-smtpd/run file. Refer to the Qmail-Scanner home page for setup examples.

QMAIL-SCANNER / SPAMASSASSIN NOTES :

How can I tell if SpamAssassin is working?

Each time SpamAssassin processes a message, it will log some information to /var/log/maillog (score, message size, time taken to process)

Not all mail gets passed through SpamAssassin

We have configured our supervise/qmail-smtpd/run script so that it runs Qmail-Scanner for every mail message. This means all incoming and outgoing mail will get virus-checked. However this doesn’t necessarily mean that every message passing through Qmail-Scanner will also get sent through SpamAssassin.

Qmail-Scanner has been coded so that messages are only passed onto SpamAssassin if the RELAYCLIENT variable from tcp.smtp is not set. The idea behind this to reduce load on the system by not running SpamAssassin on mail originated by your users.

It is possible to force SpamAssassin checking for local users if you choose by setting QS_SPAMASSASSIN=”on” for the appropriate entries in your tcp.smtp file

You can read more about this subject at the Qmail-Scanner FAQ page

Is it possible to configure per-user settings for SpamAssassin?

It depends on your configuration. We believe it will be possible to implement an interface so that vpopmail users can turn SpamAssassin checking on/off, and also set their own custom required_hits. We are hoping to store these settings as additional columns in the vpopmail MySQL database… Stay tuned and we will post more info as it comes to hand

Can I make it so that all the spam get sent to my a SPAM or TRASH folder?

Yes, have a look at this example, or take a look at the $smaildir option in the qmail-scanner-st patch

Qmail-scanner’s quarantine directory

Each virus infect mail message gets quarantines into the following directory :

So you will need to periodically purge the files from that dir, or else your hard disk will eventually fill up!

eg setup a crontab entry like this :

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *