User Tools

Site Tools


qmail

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
qmail [2009/04/24 00:55]
k2patel created
qmail [2020/08/10 02:35] (current)
Line 1: Line 1:
 ====== Qmail ====== ====== Qmail ======
 +  * [[ qmail debian install ]]
  
 ==== Setting up RBL for qmail ==== ==== Setting up RBL for qmail ====
 +Add this code to qmail service startup file.
 <code bash> <code bash>
 if [ -f /​var/​qmail/​control/​spamhaus ]; then if [ -f /​var/​qmail/​control/​spamhaus ]; then
Line 11: Line 13:
 fi fi
 </​code>​ </​code>​
 +
 +==== Block sender based .qmail (Bouncesaying) ====
 +
 +Here is the quick work around to block sender / domain using .qmail for user OR domain.\\
 +  * To disable "​ketan@xyz.com"​ on domain "​pqr.com"​ add code to file '​.qmail-default' ​ under domain directory
 +  * To disable "​ketan@xyz.com"​ on "​info@pqr.com"​ add code to file '​.qmail-info'​ under domain directory.
 + 
 +== To block sender : ==
 +
 +
 +<code bash>
 +
 +| if [ "​${SENDER}"​ = "​ketan@xyz.com"​ ]; then /​var/​qmail/​bin/​bouncesaying '​RESTRICTED:​ Domain policy disallows sending email to our domain.';​ fi;
 +
 +</​code>​
 +
 +
 +== To block Domain : ==
 +
 +Blocking xyz.com to send email to ketan@pqr.com
 +
 +<code bash>
 +
 +| /​var/​qmail/​bin/​bouncesaying '​RESTRICTED:​ Domain policy disallows sending email to our domain.'​ sh -c 'echo $SENDER | grep -qi "​@xyz.com$"'​
 +
 +</​code>​
 +
 +== To forward if outgoing match ==
 +<code bash>
 +|if [ "​$SENDER"​ = "​support@test.k2patel.in"​ ]; then /​var/​qmail/​bin/​forward fire@power.com;​ fi
 +</​code>​
 +
 +NOTE :
 +- This line must be appear first in file
 +- when you restrict for user you must add user Maildir line after this line.
 +e.g. "/​usr/​local/​vpopmail/​domains/​9/​W/​pqr.com/​info/​Maildir/"​
qmail.1240534537.txt.gz ยท Last modified: 2020/08/10 02:30 (external edit)