Hi,
 
To do this we need:

- qmailqueue patch applied to qmail (as in qmailrocks quide)
- qmail-qfilter (http://untroubled.org/qmail-qfilter/)
- gblibs (http://untroubled.org/bglibs/)
- altermime (http://www.pldaniels.com/altermime/)

(see the authors pages for more info, I also got the main concept of this 
solution reading this italian mailing list: 
http://lists.ziobudda.net/pipermail/...ne/000868.html) thanks!

process

get the stuff

# cd /downloads
# wget http://untroubled.org/qmail-qfilter/...2.0-1.i386.rpm
# wget ftp://ftp.pbone.net/mirror/untrouble...022-1.i386.rpm
# wget http://www.pldaniels.com/altermime/a...e-0.3.6.tar.gz

Install it

# rpm -Uvh bglibs-1.022-1.i386.rpm
# rpm -Uvh qmail-qfilter-2.0-1.i386.rpm

for altermime 

# tar xvzf altermime-0.3.6.tar.gz
# cd altermime-0.3.6
# make
# make install

Now we create the disclaimer files in /var/qmail/control/disclaimer as 
yourdomain.com.txt and yourdomail.com.html (every virtual domain can have its 
disclaimer, or even no disclaimer if there is no file matching)

Now we change the files permissions

# chown vpopmail:qmail /var/qmail/control/disclaimer/*
# chmod 400 /var/qmail/control/disclaimer/*

Now let's go for the scripts

Create the file /var/qmail/bin/qmail-tail

# touch /var/qmail/bin/qmail-tail

add this to the script:

#!/bin/sh
exec /usr/bin/qmail-qfilter /var/qmail/bin/qmail-disclaimer

now change owner and permissions

# chown vpopmail:qmail /var/qmail/bin/qmail-tail
# cwmod 500 /var/qmail/bin/qmail-tail

Create the directory /var/tmp/qmail-qfilter

# mkdir /var/tmp/qmail-qfilter
# chown vpopmail:qmail /var/tmp/qmail-qfilter
# chmod 500 /var/tmp/qmail-qfilter

Create the file /var/qmail/bin/qmail-disclaimer

# touch /var/qmail/bin/qmail-disclaimer

add this to the script:

#!/bin/sh

INSPECT_DIR=/var/tmp/qmail-qfilter
if [ ! -f /var/qmail/control/disclaimer/$QMAILHOST.txt ]
then
cat
exit 0
fi
EX_TEMPFAIL=31
EX_UNAVAILABLE=31
trap "rm -f /var/tmp/qmail-qfilter/in.$$" 0 1 2 3 15
cd $INSPECT_DIR || { echo Error: $INSPECT_DIR does not exist; exit 
$EX_TEMPFAIL; }
cat >$INSPECT_DIR/in.$$ || { echo Error: Cannot write to disk; exit 
$EX_TEMPFAIL; }

/usr/local/bin/altermime --input=$INSPECT_DIR/in.$$ \
--xheader="X-Disclaimer: $QMAILHOST" \
--disclaimer=/var/qmail/control/disclaimer/$QMAILHOST.txt \
--disclaimer-html=/var/qmail/control/disclaimer/$QMAILHOST.html || { echo 
Error: message rejected; exit $EX_UNAVAILABLE; }

cat $INSPECT_DIR/in.$$
rm in.$$
exit $?

now change owner and permissions

# chown vpopmail:qmail /var/qmail/bin/qmail-disclaimer
# chmod 500 /var/qmail/bin/qmail-disclaimer

Now edit the file /etc/tcp.smtp mine looks like this:

127.:allow,RELAYCLIENT=""
192.168.1.:allow,RELAYCLIENT="",QMAILQUEUE="/var/qmail/bin/qmail-tail"

Finally rebuild the SMTP CDB file by doing:

# qmailctl cdb

and restart qmail

# qmailctl restart

That's all! Now you should have a disclaimer at the bottom of every mail sent 
through you server.



Kind Regards,
Mubeen Nakade.
 
"Being the best is not at all important, doing the best is all that matters"

--- On Thu, 22/1/09, ashok abraham <[email protected]> wrote:

From: ashok abraham <[email protected]>
Subject: [LinuxVadaPav] how to add a disclaimer footer with qmail
To: [email protected]
Cc: [email protected]
Date: Thursday, 22 January, 2009, 1:31 PM






How to add a disclaimer footer message with all outgoing mails 
with qmail as Mta

i had googled the same but no working solution found

any one has any working solution please inform 

regards

ashok abraham

Add more friends to your messenger and enjoy! Go to http://messenger. 
yahoo.com/ invite/

 














      Connect with friends all over the world. Get Yahoo! India Messenger at 
http://in.messenger.yahoo.com/?wm=n/

[Non-text portions of this message have been removed]

Reply via email to