Bowie Bailey writes:

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?

No, that's going to do exactly what you think. The thing is that anyone can send an E-mail using anyone's return address, to a malicious entity with advance knowledge of this can use you to flood this address with bounces.

This is exactly what rcptfilter is designed to do.


Attachment: pgpEUdr8iLfyB.pgp
Description: PGP signature

Reply via email to