Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
TetraWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Second Instance of Qmail for Disclaimer
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Disclaimer Related Implementation = cd /downloads/ rpm βUvh bglibs-1.022-1.i386.rpm ( get it from http://untroubled.org/bglibs/ ) or tar -xvfz bglibs-1.022-1.tar.gz cd bglibs-1.022-1 make make install tar xvzf altermime-0.3.6.tar.gz (get it from http://www.pldaniels.com/altermime/ ) cd altermime-0.3.6 make make install tar xvzf qmail-qfilter-2.1.tar.gz (http://untroubled.org/qmail-qfilter/) cd qmail-qfilter-2.1 vi qmail-qfilter.c ( change qmail into qmail2 ) <nowiki>------------------------------------------------------------------------------------------------------</nowiki> <nowiki>#ifndef QMAIL_QUEUE</nowiki> <nowiki>#define QMAIL_QUEUE "/var/qmail2/bin/qmail-queue"</nowiki> <nowiki>#endif </nowiki> <nowiki>------------------------------------------------------------------------------------------------------</nowiki> make make install chmod 777 /usr/local/bin/qmail-qfilter chown root:qmail /usr/local/bin/qmail-qfilter vi /var/qmail2/bin/qmail-tail <nowiki>#!/bin/sh</nowiki> exec /usr/local/bin/qmail-qfilter /var/qmail2/bin/qmail-disclaimer chown root:qmail /var/qmail2/bin/qmail-tail chmod 777 /var/qmail2/bin/qmail-tail mkdir /var/qmail2/control/disclaimer/ cd /var/qmail2/control/disclaimer vi hindustantimes.com.html <nowiki>-----------------------------------------------------------------------------------------------------</nowiki> <nowiki><html></nowiki> <nowiki><body></nowiki> IMPORTANT NOTICE: "This email is confidential containing HT Media confidential information, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender." Experience news. Like never before. Only on www.hindustantimes.com <nowiki></body></nowiki> <nowiki></html></nowiki> <nowiki>-------------------------------------------------------------------------------------------------------</nowiki> vi hindustantimes.com.txt <nowiki>-------------------------------------------------------------------------------------------------------</nowiki> IMPORTANT NOTICE: "This email is confidential containing HT Media confidential information, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender." Experience news. Like never before. Only on www.hindustantimes.com <nowiki>------------------------------------------------------------------------------------------------------</nowiki> chown root:qmail /var/qmail2/control/disclaimer/* chmod 777 /var/qmail2/control/disclaimer/* mkdir /var/tmp/qmail-qfilter chown root:qmail /var/tmp/qmail-qfilter chmod 777 /var/tmp/qmail-qfilter vi /var/qmail2/bin/qmail-disclaimer #!/bin/sh INSPECT_DIR=/var/tmp/qmail-qfilter if [ ! -f /var/qmail2/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/qmail2/control/disclaimer/$QMAILHOST.txt \ --disclaimer-html=/var/qmail2/control/disclaimer/$QMAILHOST.html || { echo Error: message rejected; exit $EX_UNAVAILABLE; } cat $INSPECT_DIR/in.$$ rm in.$$ exit $? chown root:qmail /var/qmail2/bin/qmail-disclaimer chmod 777 /var/qmail2/bin/qmail-disclaimer == Activation of Qmail2 == Changes on Qmail2-Send run file vi /service/qmail2-smtpd/run ( add following line at the top ) <nowiki>#!/bin/sh</nowiki> QMAILQUEUE="/var/qmail2/bin/qmail-tail"; export QMAILQUEUE Also Make sure the Qmail-smtpd is running on port 900 by vi /etc/services <nowiki># Local services</nowiki> second-qmail 900/tcp Integrate Qmail with Qmail2 vi /var/qmail/control/smtproutes :127.0.0.1:900 Note: Then restart the qmail from /etc/inittab file. == Testing == # telnet and send mail via Qmail-2 , you should get the disclaimer # Test via offline Client like Evolution , Outlook etc . You should get the mail with disclaimer attached . == Troubleshooting == 1. QQ error while sending mails Check the smtp logs , if find error like ''/usr/local/bin/qmail-qfilter: error while loading shared libraries: libbg-sysdeps.so.1: cannot open shared object file: No such file or directory'' Then you have to link libbg-sysdeps.so.1 to /usr/lib ln -s /usr/local/bglibs/lib/libbg-sysdeps.so.1 /usr/lib/ This should solve the issue 2. Some time the Qmail-1 is not able to deliver mails to Qmail-2 instance due to /var/tmp/qmail-qfilter directory is not there or vanishes. So a script to check and create the directory with cron is created for taking care of this issue. The script is /usr/bin/check_qmail-qfilter_dir.sh #!/bin/sh DIRECTORY=/var/tmp/qmail-qfilter if [ ! -d "$DIRECTORY" ]; then mkdir -p $DIRECTORY; chmod 777 $DIRECTORY; chown -R root.qmail $Directory fi The cron entry is as follows */5 * * * * /usr/bin/check_qmail-qfilter_dir.sh
Summary:
Please note that all contributions to TetraWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TetraWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)