User Tools

Site Tools


qmail

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
qmail [2009/05/12 10:06]
k2patel
qmail [2010/03/09 22:24] (current)
k2patel
Line 13: 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 "​[email protected]"​ on domain "​pqr.com"​ add code to file '​.qmail-default' ​ under domain directory
 +  * To disable "​[email protected]"​ on "​[email protected]"​ add code to file '​.qmail-info'​ under domain directory.
 + 
 +== To block sender : ==
 +
 +
 +<code bash>
 +
 +| if [ "​${SENDER}"​ = "​[email protected]"​ ]; 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 [email protected]
 +
 +<code bash>
 +
 +| /​var/​qmail/​bin/​bouncesaying '​RESTRICTED:​ Domain policy disallows sending email to our domain.'​ sh -c 'echo $SENDER | grep -qi "​@xyz.com$"'​
 +
 +</​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.txt ยท Last modified: 2010/03/09 22:24 by k2patel