While using Qmail the biggest problem for me was Messages sent to Non Exsistant User Accounts. Qmail actualy Accept those Messages and then Generates a Mailer Daemon Msg. Most Of the time That Mailer Daemon Msg recided in the Mail Queue and causeing problem as there were huge such mails. I have Solved this Issue with the help from Spamcontrol. (http://www.fehcom.de/qmail/spamcontrol.html). It’s Easy to use also. You Download the Tarball, Patch Qmail and Compile. Then you need some configuration to get your self going. I use 2 features of Spamcontrol, One that checks for Valid Users and another one which checks for Valid Domains which are allowed to send mails via my SMTP. For the First one you need to do the following.
Under /var/qmail/users/ make a file named recipients with all the email ID’s that You accept Mail. Like This
Then run this command to make a cdb file from the Recipients file. /var/qmail/bin/qmail-recipients . Then Create another file under /var/qmail/control/ as recipients with this content.
users/recipients.cdb
Now If you chk your SMTP log file You will see some Entry’s like this.
@4000000048a2703128147d8c Accept::RCPT::Rcpthosts_Rcptto: P:ESMTP S:216.139.212.228:smtp.trustmail.in H:smtp.trustmail.in F:news@steelguru.com T:noc@xyz.com
So Your Spamcontrol is running and It Will Bounce the message if the user is not there in the recipients.cdb file. One thing You have to remeber that after enabling this, when you add a new mail user you’ll have to add that in the /var/qmail/users/recipients file and remake the cdb by /var/qmail/bin/qmail-recipients. Other wise that user will not be able to get mail from Outside.
Now for the second part, you need to add this in your /etc/tcp.smtp LOCALMFCHECK=”" for the allowed IP’s. Like this
203.202.201.11:allow,RELAYCLIENT=”",LOCALMFCHECK=”"
And your /var/qmail/control/rcpthosts file should have all the Domain names that are allowed to use your SMTP Server. Then run qmailctl cdb to remake the cdb file and you are good to go.
I found this two tools very Helpfull, Hope you will also.
i want to format the log in the follwing format.
@4000000048a2703128147d8c Accept::RCPT::Rcpthosts_Rcptto: P:ESMTP S:216.139.212.228:smtp.trustmail.in H:smtp.trustmail.in F:news@steelguru.com T:noc@xyz.com
Please giud me installation of spam controll.
after running the installation script of spamcontroll.
compilation of qmail gives error .
Please guide me
By: sunil on January 17, 2009
at 4:16 pm
Dear Sunil,
From where you are installing Qmail? Qmailrocks ?
you cann’t use the Big Qmail Patch of that script with Spamcontroll and also you cann’t use TAPS with it. Please try without those and be more specific about the Error you are getting.
Thanks
Mahin
By: Mahin on January 18, 2009
at 7:59 am
thanks for your reply.
i follwed the follwing steps for installing spam controll.
1. copy and extract the spam controll in the source dir
/usr/src/qmail/qmail-1.03/
2. install the spam controll with default conf-spamcontroll by the installation script.
3. and make the recipirnt file and recipint.cdb file.
start the service again.
check the logs of qmail-smtp
but i did not get these types of logs.
Please help me.
thanks.
By: sunil on January 19, 2009
at 11:54 am
Dear Sunil,
After Step 2 did u recompile Qmail with
“make && make setup check” ?
By: Mahin on January 20, 2009
at 8:13 am
thanks sir for uour reply
yes i did it
but not sucess.
Please help me sir
one another issue
i change the script of qmail-smtpd/run to get these types of logs.
but i lost more
now i am not able to get old log also
my curently logs are as follow
@4000000049758a92153f4714 tcpserver: status: 1/30
@4000000049758a92153f6654 tcpserver: pid 6720 from 127.0.0.1
@4000000049758a9224eac864 tcpserver: ok 6720 tiplmail2.toshiba-india.com:127.0.0.1:900 :127.0.0.1::38518
@4000000049758a9a0871e744 tcpserver: end 6720 status 0
@4000000049758a9a0871f2fc tcpserver: status: 0/30
it is much bad for me.
i replace orignol file but not get old type of logs.
i have worked out too much.
Please sir you are the only hope.
my contact no 9873936941
thanks.
By: sunil on January 20, 2009
at 2:50 pm
Dear Sunil,
Pls Chk u r Gmail A/C and let me know the feedback.
By: Mahin on January 20, 2009
at 9:43 pm
Dear sir
i checked my gmail account. but i did not get any mail.
i need the solution for the folwing types of logs.
@4000000048a2703128147d8c Accept::RCPT::Rcpthosts_Rcptto: P:ESMTP S:216.139.212.228:smtp.trustmail.in H:smtp.trustmail.in F:news@steelguru.com T:noc@xyz.com
i can install it again if required.
Thanks.
By: sunil on January 21, 2009
at 11:09 am
Dear sir
sorry i got mail on other account not on gmail account.
where to replace qmail-smtpd file.
thanks
By: sunil on January 21, 2009
at 12:42 pm
Dear Sunil,
First Stop Qmail. With This Commands
/var/qmail/bin/qmailctl stop
kill -9 `/bin/ps -ef | awk ‘/qmails.*qmail-send/ { print $2 }’`
Then Take a back up of u r /var/qmail/bin/qmail-smtpd file. Then Replace that file with the one I sent u. And Did chk the /var/qmail/control/recipients file?
Pls let me know whats the output.
By: Mahin on January 22, 2009
at 11:38 am
Good going sir, carry on……………
By: Rashedul Ahsan on August 8, 2009
at 1:17 pm