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 14:06]
k2patel
qmail [2020/08/10 02:35] (current)
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 "​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.1242137206.txt.gz ยท Last modified: 2020/08/10 02:30 (external edit)