+ "Brian Longwe" <[EMAIL PROTECTED]>:
| Hi,
|
| I want to filter out messages with the following header from being
| sent out by a user on my system:
| ---------------------------------------------
| Hi. This is the qmail-send program at relay.ispkenya.com.
| I tried to deliver a bounce message to this address, but the bounce bounced!
|
| <[EMAIL PROTECTED]</=>:
| Sorry, I couldn't find any host named compuserve.com</=. (#5.1.2)
|
| --- Below this line is the original bounce.
[ ...]
| ---------------------------------------------
|
| I have tried putting some portions of the above in the badmailfrom control
| file to no avail. Any tips?
That doesn't work because not only is the above text not in the header
- it is in the body of the incoming message - but the badmailfrom file
only controls messages based on the envelope from, which is not even
in the header, it's outside the message itself. (Read the
envelopes(5) man page to see what I mean.)
In this case, the message is a doublebounce, so the envelope sender
will be <#@[]> (it will be in the Return-Path header field after the
message is finally delivered).
Here is what you can do:
# cat > /var/qmail/alias/.qmail-doublebounce << 'EOT'
|if grep '[EMAIL PROTECTED]'; then exit 99; else exit 0; fi
&postmaster
EOT
# echo doublebounce > /var/qmail/control/doublebounceto
Then restart qmail.
To understand what this all means, read the dot-qmail, qmail-command
and qmail-send manual pages. Read them before you do anything; the
above advice is just off the top of my head and untested, and you
should understand the solution and its consequences yourself before
implementing it.
- Harald