Christian Lerrahn writes:
Hi,
I'm desperately trying to get maildrop to bounce an email based on its
size. What I've put in my .mailfilter is the following.
if ( $SIZE > 100000)
{
to "|/var/qmail/bin/bouncesaying 'Message too big'"
}
The detection of the size seems to work correctly but what I find in the
logs is
2005-06-10 14:02:55.259169500 status: local 2/10 remote 0/20
2005-06-10 14:02:55.332340500 delivery 220280: success: did_0+0+1/
2005-06-10 14:02:55.332346500 status: local 1/10 remote 0/20
2005-06-10 14:02:55.823625500 delivery 220281: success: Message_too_big/
maildrop:_error_writing_to_filter./did_0+0+1/
and the message will just be delivered. The strange thing is that the
error code of bouncesaying seems to be the same as the one vdelivermail
will throw if the email has to be bounced by vpopmail (code 100).
Nevertheless vdelivermail bounces work but the bouncesaying ones don't.
What am I doing wrong? How do I get maildrop to recognize this as failed
and hand over the error code 100 to qmail so that qmail bounces the email?
There are a couple of things wrong here:
1) You've instructed maildrop to pipe the message to an external program,
"bouncesaying". maildrop expects this program to read the message and
process it. bouncesaying failed to read the entire message. Although it's
not possible for maildrop to detect this in all circumstances, when maildrop
detects that the program terminated without reading the message, it
correctly interprets it as a failure.
2) You should avoid bouncing mail after it's already accepted by your mail
server. What you're doing might've been tolerable years ago, but on today's
Internet, where an estimated 75% of all E-mail is spam with forged return
addresses, sending backscatter bounces to forged return addresses --
especially in situations where they are easily preventable -- is considered
abusive.