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: , , , ,

Jan 27

qmail + SPAMD +FC12 error:

 error: Can’t locate Crypt/OpenSSL/ in @INC (@INC contains: /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/
local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/si
te_perl) at /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/Crypt/OpenSSL/ line 17.

solution: run cpan and install Crypt::OpenSSL::Bignum module.

> cpan

>install Crypt::OpenSSL::Bignum

written by MG \\ tags: , , ,

Jan 26

if you want to modify qmailadmin to check if new password is strong you can do like this:

edit qmailadmin.c and:

add:   #include <ctype.h>

I wrote a function to check if new password contains at least 1 alphachar and 1 digit.

add it before int main(argc,argv)

int check_strong(char *pass_string)
    int digit=0;
    int alpha=0;
    int length=strlen(pass_string);
    int i;
       if( digit == 1 && alpha == 1 ) return 1;
                  if(isdigit(pass_string[i])) digit=1;
                  if(isalpha(pass_string[i])) alpha=1;
    return 0;
Continue reading »

written by MG \\ tags: , , , ,

Jan 18


./load ezmlm-gate subdb.a getconf.o slurpclose.o slurp.o \
getopt.a getln.a auto_bin.o env.a sig.a fs.a \
strerr.a substdio.a stralloc.a alloc.a error.a str.a case.a wait.a \
open.a lock.a seek.a -L/usr/lib64/mysql -lmysqlclient -lnsl -lm -lz
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [ezmlm-gate] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.578TXA (%build)

check if you have:


if not, make a link :

 ln -s /usr/lib/mysql/ /usr/lib64/

 in /usr/lib/mysql/  you must have something like this:

 libmysqlclient_r.a -> -> -> ->

written by MG \\ tags: , , ,

Jul 16

if you get something like this:

error: Bad exit status from /var/tmp/rpm-tmp.64195 (%build)

i found a solution:

go to /usr/src/redhat/SOURCES/ and you will find:

-rw-r–r– 1 root root 196944 2006-11-10 02:14 simscan-1.3.1.tar.bz2
-rw-r–r– 1 root root 256 2007-01-12 02:22 simscan-1.3.x-clamav.patch.bz2

unpack simscan-1.3.1.tar.bz2 to a directory, unpack simscan-1.3.x-clamav.patch.bz2 to the same directory and apply patch:

patch -p 0 < simscan-1.3.x-clamav.patch now let's compile by hand: #./configure --enable-user=clamav --enable-clamav=y --enable-spam=y --enable-spam-passthru=n --enable-per-domain=y --enable-ripmime --enable-attach=y --enable-received=y --enable-clamdscan=/usr/bin/clamdscan --enable-clamavdb-path=/usr/share/clamav/ --enable-custom-smtp-reject=y --enable-spam-hits=20 --enable-workdir=/var/qmail/simscan/ --enable-controldir=/var/qmail/control/ --enable-received=y #make #make install-strip #cd /var/qmail/control/; touch simcontrol; edit file simcontrol and add: :clam=yes,spam=yes,spam_hits=10,attach=.mp3:.src:.bat:.pif:.exe #chown clamav.root simcontrol #qmailctl cdb and now you must have in /var/qmail/control/ this files: -rw-r--r-- 1 clamav root 64 2008-07-16 14:05 simcontrol -rw-r--r-- 1 root root 2134 2008-07-16 14:05 simcontrol.cdb -rw-r--r-- 1 root root 2164 2008-07-16 14:05 simversions.cdb and in /var/qmail/bin/: -rws--x--x 1 clamav root 27032 2008-07-16 17:03 /var/qmail/bin/simscan -rwxr-xr-x 1 root root 13120 2008-07-16 17:03 /var/qmail/bin/simscanmk I hope this is ok!

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: , , ,