Integrate Spamassassin with Qmail

Install the following package in order to integrate spamassassin with qmail.
1. mess822 package (http://www.thedjbway.org/mess822/installation.html)
2. Spamassassin (http://spamassassin.apache.org/downloads.cgi)

Installing mess822 package
******************************
#cd /usr/local/src
#wget http://cr.yp.to/software/mess822-0.58.tar.gz
#tar -xzf mess822-0.58.tar.gz
#cd mess822
#make
#make setup check

Integrating spamassassin with qmail
****************************************
Download ifspamh script and copy it to /usr/local/bin.

#wget http://www.gbnet.net/~jrg/qmail/ifspamh/ifspamh.1.5
#cp ifspamh.1.5 /usr/local/bin/ifspamh
#chmod +x /usr/local/bin/ifspamh

Check if location of spamc is mentioned correctly within ifspamh script.
example:
SPAMC=/usr/bin/spamc

Suppose you have a mail user test@example.com with his Maildir at /home/example.com/test/Maildir and the dot qmail file /home/example.com/.qmail-test. Then .qmail-test must looks like:

|/usr/local/bin/ifspamh test-spam@example.com
./Maildir/

Now add a file /home/example.com/.qmail-test-spam with the following contents

/home/example.com/test/Maildir/

If you want to discard spam mails, just put a # at the first line of /home/example.com/.qmail-test-spam

If you get the following error, check out for the fix below;

Error
mess822-0.58]# make
./load iftocc mess822.a getln.a strerr.a substdio.a \
stralloc.a alloc.a error.a env.a str.a case.a fs.a open.a
/usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in strerr.a(strerr_sys.o)
/lib/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [iftocc] Error 1

make
make check install

Fix
This is the most often reported installation error. This is caused because the program does not contain the errno.h file.

you get the above errors while installing mess822 package.

You can fix this problem by modifying two configurations files. (Changes to any one of the conf file may work, but sometimes you may have to edit both confs).

Move present conf-cc to conf-cc.back and create a new conf-cc to read:
gcc -O2 -include /usr/include/errno.h

Do the following modifications In the error.h file.

remove the line:
extern int errno;

add the line:
#include <errno.h>

Now, the compilation should work fine.

Originally posted on : mohammednv.wordpress.com

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s