MailScanner with qmail

Pravin Rane pravin.rane at
Mon Feb 9 17:38:37 GMT 2009

Qmail + MailScanner integration is not officially supported by Julian,
but there are many who are successfully running MailScanner + Qmail
Qmail lack most of the modern email server functionality, which
Postfix and Exim has. I know there are many patches and a cool
vpopmail like virtual domain application available for Qmail which
other MTAs don't, so here are the steps

Compile and install qmail as mentioned on D. J. Bernstein site or use qmail toaster

backup your qmail source
cd to your qmail source ( qmail-1.03 )

And run following commands

perl -e 's/qmail-queue/qmail-queue.default/g' -pi qmail.c
perl -e 's/\"queue\"/QUEUE/g' -pi qmail-queue.c
ed qmail-queue.c << EOF
#define QUEUE ""
make qmail-inject qmail-queue
mv qmail-inject /var/qmail/bin/qmail-inject.mailscanner
mv /var/qmail/bin/qmail-queue /var/qmail/bin/qmail-queue.default
mv qmail-queue /var/qmail/bin/qmail-queue
chown root:qmail /var/qmail/bin/qmail-inject.mailscanner
chown qmailq:qmail /var/qmail/bin/qmail-queue
chmod 4711 /var/qmail/bin/qmail-queue
mkdir -p /var/qmail/
perl -e 'foreach $i (0..23) {`mkdir /var/qmail/$i`};'
mkdir -p /var/qmail/
mkdir -p /var/qmail/
mkdir -p /var/qmail/
chown -R qmailq.qmail /var/qmail/
chmod 750 /var/qmail/

Make sure following are the content of MailScanner.conf
Run As User = qmailq
Run As Group = qmail
Incoming Queue Dir = /var/qmail/
Outgoing Queue Dir = /var/qmail/queue/mess
Incoming Work Dir = /var/spool/MailScanner/incoming
Quarantine Dir = /var/spool/MailScanner/quarantine
MTA = qmail
Sendmail = /var/qmail/bin/qmail-inject.mailscanner
Sendmail2 = /var/qmail/bin/qmail-inject.mailscanner
Qmail Hash Directory Number = 23
Qmail Intd Hash Number = 1

              Deliver messags to
Qmail port 25 ------------------->|/var/qmail/|

External Mail server-                        \|/
                     \                                 |
              INBOX -

For testing run MailScanner --lint

On Mon, Feb 9, 2009 at 8:41 PM, Ismail OZATAY <ismail at> wrote:
> Hi there ;
> I am trying to implement qmail with mailscanner. I tried a patch in web page. I read and applied all intructions on this page but could not worked. After I applied this patch server accepts mail but do not send anywhere , i mean put inboxes. Is there anybody using qmail with mailscanner without any problem ?
> Regards,
> ismail
> --
> MailScanner mailing list
> mailscanner at
> Before posting, read
> Support MailScanner development - buy the book off the website!



More information about the MailScanner mailing list