another mailrules quirk (databytes)

Janos Farkas <[email protected]>
Newsgroups gmane.comp.sysutils.bgware
Message-ID <[email protected]>
Suppose I have the following mailrules file:

==== mr ====
n*@*:*@x3*::2000
n*@*:*@x2*::200
n*@*:*@x1*::20
n*@*:*@xx*::::SAMPLE=sample
==== mr ====

Which should limit @x3 addresses to 2000 bytes, @x2 to 200, etc..  

==== testmr ====
#!/bin/sh

MAILRULES=`pwd`/mr
export MAILRULES

{
echo "helo helohost"
echo "mail from: <[email protected]>"
echo "rcpt to: <[email protected]>"
echo "rcpt to: <$1@$1.local>"
echo "data"
echo "Subject:"
echo "X-Whatever"
echo
echo "01234567890123456789"
echo .
#sleep 1
echo quit
#sleep 1
}|smtpfront-echo
==== testmr ====

When I run it with "tmr bb" (attempting to deliver to x1@x1, and
bb@bb), it will fail with the databytes limit.  Obviously, because @x1
delivery is limited to 20 bytes.  When ran with "tmr xx" (delivering
to xx@xx), it will not fail!  I'd be prepared to any ordering quirks
between rules, when multiple databyte limits apply, but this seems to
be not the case..

Even "tmr x1", delivering to x1@x1 twice, seems to succeed somehow...

I'm confused; debugging via a printf in apply_rule():
- delivering to x1@x1 and then bb@bb
applies a databytes limit of 20. ok. rejects mail
- delivering to x1@x1 and then xx@xx
applies a databytes limit of 0. accepts mail (IMHO, not good)
- delivering to x1@x1 and then x1@x1
seems to apply a databytes limit of 20 twice(?), but accepts the mail(?)

Shall I prepare a "normal" test case as a diff?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.