Mar 10

I have qmailtoaster installation so my users are in:


you need two create two file:

first called “mailfilter” can be put wherever you want (this file will be in .qmail file), me  I choose:


so now I have:


second called “.qmail” must be pun in user folder in the same dir with Maildir folder, like this:


File contents are:


|preline /usr/bin/maildrop /home/vpopmail/domains/mailfilter


import EXT
import HOST
logfile “/var/log/maildrop/mailfilter.log”
USERHOME=`/home/vpopmail/bin/vuserinfo -d $EXT@$HOST`
if (/^Subject:.*\[SPAM\]/:h)
log “WE got a SPAM, moving mail to spam directory $USERHOME/Maildir/.Junk”
DUMMY=`test -d $USERHOME/Maildir/.Junk`
#if .Junk folder exists
if ( $RETURNCODE == 0 )
to “$USERHOME/Maildir/.Junk”
log “No Junk directory in $USERHOME/Maildir”
to “$USERHOME/Maildir/”
to “$USERHOME/Maildir/”

This works for users in witch dirs you put .qmail file. If you want for whole domain you must use :

/home/vpopmail/domains/MYDOMAIN.XXX/.qmail-default file instead of .qmail in user directory.

written by MG \\ tags: , , ,

Jan 30

First locate simcontrol file at /var/qmail/control

The default file looked like this:


If you want to just stop spam processing for a single user you have to put:,spam=no,spam_hits=10

in front of existing line, result:,spam=no,spam_hits=10

for an entire domain just put:,spam=no,spam_hits=10

Save an run #qmailctl cdb


written by MG \\ tags: , , , ,

Jun 03

1. First stop qmail: “qmailctl stop”

2. Go to /var/qmail/supervise/ and  copy entire smtp directory to smtp-ssl .

Edit /var/qmail/supervise/smtp-ssl/run by adding :

export SMTPS

after line: VCHKPW=”/home/vpopmail/bin/vchkpw”  and change port from smtp to 465 .

Now file should look like this:

QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
export SMTPS

exec /usr/bin/softlimit -m 12000000 \
    /usr/bin/tcpserver -v -R -H -l $HOSTNAME -x $TCP_CDB -c “$MAXSMTPD” \
    -u “$QMAILDUID” -g “$NOFILESGID” 0 465 \
    $SMTPD $VCHKPW /bin/true 2>&1

3. Edit /var/qmail/supervise/smtp-ssl/log/run :

change /var/log/qmail/smtp  to /var/log/qmail/smtp-ssl

Continue reading »

written by MG \\ tags: , , ,

Apr 15

Due to the increase in the number of ISP’s blocking port 25 for third party mailservers I decided to setup my mailserver to answer SMTP request on multiple ports. While this can be accomplished in many ways, such as port forwarding or multiple instances of qmail-smtpd, my situation required setting up a second instance or qmail-smtpd.

The setup process is fairly straight forward. Here are the steps I took to accomplish my goal:

First you will need to stop qmail and make a copy of your qmail-smtpd directory located in /var/qmail/supervise/smtp. I called my new copy /var/qmail/supervise/smtp2. Once the copy had been completed I then needed to edit the run file located in the smtp2 directory. This was a simple change to add the port number I wished to have qmail-smtpd run on. Here is an example:


/usr/local/bin/tcpserver -H -v -R -l “$LOCAL” -x /etc/tcp.smtp.cdb -c “$MAXSMTPD” -u “$QMAILDUID” -g “$NOFILESGID” 0 smtp \


/usr/local/bin/tcpserver -H -v -R -l “$LOCAL” -x /etc/tcp.smtp.cdb -c “$MAXSMTPD” -u “$QMAILDUID” -g “$NOFILESGID” 0 2525 \


Notice the 2525 which is the second port I will be running. Please be aware that this line may be different depending on your installation of QMail. My installation was based on the Life with Qmail instructions and also the addition of SpamAssassin, SpamHaus RBL, relay-ctrl-chk and ClamAV.

With this change complete I needed to update the run file located in the /var/qmail/supervise/smtp2/log directory. I just changed the logging path to log to a second log named smtp2.

Start qmail.

verify:  “netstat -natp|grep tcpserver” and you should see:

tcp        0      0        *                   LISTEN      31692/tcpserver
tcp        0      0      *                   LISTEN      31735/tcpserver


written by MG \\ tags: , , ,