Bowie Bailey wrote:
> I have received a request from one of my users to block emails to
> their domain from a particular address. Since I don't want to block
> the address from the entire server, I think the place to do it is from
> maildrop. What I can't figure out is how to direct maildrop to bounce
> the message.
>
> What command can I give to maildrop to make it send a dsn back to the
> sender? And can I specify the error message?
To answer my own question, I was able to do it like this:
LCSENDER=tolower($SENDER)
if ( $LCSENDER eq "[EMAIL PROTECTED]" )
{
echo "This account is not accepting mail from $SENDER"
EXITCODE=64
exit
}
I was going to do a recipient rule and put it in
/etc/courier/maildroprc, but I decided to put it in the individual
user's .mailfilter files instead so that any errors would be limited to
that one domain.
The rule for maildroprc would have looked like this:
LCRECIP=tolower($RECIPIENT)
LCSENDER=tolower($SENDER)
if ( $LCRECIP =~ /@mydomain\.com/ && $LCSENDER eq
"[EMAIL PROTECTED]" )
{
echo "This account is not accepting mail from $SENDER"
EXITCODE=64
exit
}
Does anyone see any problems with this?
--
Bowie
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users