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
Next revision
Previous revision
qmail [2009/05/12 10:06]
k2patel
qmail [2019/09/20 18:01]
k2patel [Block sender based .qmail (Bouncesaying)]
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>​
 +
 +== To forward if outgoing match ==
 +<code bash>
 +|if [ "​$SENDER"​ = "​[email protected]"​ ]; then /​var/​qmail/​bin/​forward [email protected];​ 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.txt ยท Last modified: 2019/09/20 18:01 by k2patel