[exim-dev] [Bug 428] Greatly expand ratelimit features

Top Page
Delete this message
Reply to this message
Author: Dave Lugo
Date:  
To: exim-dev
Subject: [exim-dev] [Bug 428] Greatly expand ratelimit features
------- You are receiving this mail because: -------
You are the QA contact for the bug.

http://bugs.exim.org/show_bug.cgi?id=428

Dave Lugo <dlugo@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dlugo@???





--- Comment #11 from Dave Lugo <dlugo@???> 2007-07-29 20:15:30 ---
As suggested by Marc Perkel, I'm looking at using the ratelimit
feature for automated whitelisting.

I've noticed some odd behavior at odds with the docs and what
I'm trying to do.

(btw - I've verified this both pre and post patch- example below is with
the patch)

When a user at one of my provisioned domains sends an email
outbound, this is called in the rcpt acl:

          ratelimit     = 0 / 52w / per_cmd / strict / noupdate 
${lc:$sender_address}:${lc:${extract{1}{+}{$local_part}}}@${lc:$domain}


(it will likely wrap above, in my config it's all on one line).

When that fires, I see this (as an example):

root@spot> /var/www/sbin/exim_dumpdb /var/www/spool ratelimit        
29-Jul-2007 14:53:54.151117 rate:      0.000 key:
52w/per_cmd/strict/dlugo@???:david.lugo@???



Shouldn't that be a rate of '1'? (at least, that's what I want it to be). So
I looked in spec.txt a bit, and saw this re per_cmd:

"The per_cmd option causes Exim to recompute the rate every time the condition
is processed. "

I then tried calling ratelimit multiple times (first, rm'ing the current
ratelimit db). A
single message traversing this:

  accept  logwrite      = Sender rate pre1: $sender_rate
          ratelimit     = 0 / 52w / per_mail / strict / noupdate /
${lc:$sender_address}:${lc:${extract{1}{+}{$local_part}}}@${lc:$domain}
          logwrite      = Sender rate pre2: $sender_rate
          ratelimit     = 0 / 52w / per_mail / strict /
${lc:$sender_address}:${lc:${extract{1}{+}{$local_part}}}@${lc:$domain}
          logwrite      = Sender rate pre3: $sender_rate
          ratelimit     = 0 / 52w / per_mail / strict /
${lc:$sender_address}:${lc:${extract{1}{+}{$local_part}}}@${lc:$domain}



(sorry about the linewraps)

... just logs this:

Jul 29 14:53:54 spot exim[32422]: Sender rate pre1:
Jul 29 14:53:54 spot exim[32422]: Sender rate pre2: 0.0
Jul 29 14:53:54 spot exim[32422]: Sender rate pre3: 0.0


Even if I specify the same rcpt twice in the same mail sent by my
client (and verified by the logs here), the initial rate recorded
appears to remain 0.0. The current rate is incremented only on
a second (and successive) email(s) sent with the same from/to pair.

So, to autoadd a whitelist entry, the local user has to send two separate
emails. (seems silly to me :)

If the local user has sent only one email, using noupdate on return mail
will just see '0.0' as the rate. I suppose I could test for the rate being
blank, but I wonder if it's better if the initial rate recorded should just
be 1.0. Another solution would be having each successive call of per_cmd
for the same email actually increment the counter. (at least, that's what
the docs seem to suggest... :)

Thanks,

Dave


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email