Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users
Re: Is there a way to control the delivery rate?
 

Index | Next | Previous | View Flat


frob-qmail at webcentral

Dec 16, 2004, 5:56 PM


Views: 23108
Permalink
Re: Is there a way to control the delivery rate? [In reply to]

On Fri, 2004-12-17 at 10:17, Net Virtual Mailing Lists wrote:
> The reason I need to do this is because we deliver messages to a Yahoo
> group and if your delivery rate is "too high" they flag the email address
> as being an auto responder and stop delivering messages. Frankly, I
> think their solution to this problem is pretty dumb, but I doubt they are
> going to change anything for my benefit... ;-) We also have a MSN group,
> which employs a similar mechanism (although even more conservative).

Haven't noticed this with our servers, might have a closer look
at the logs. Agreed that it seems stupid.

One way to do this is to wrap qmail-remote with a rate limiter.
Move qmail-remote to qmail-remote.orig and install the script
below as qmail-remote. Create the directory control/lastdelivery
and set its ownership to qmailr. control/remoteratelimit contains
config info, colon separated domain name and minimum seconds
between deliveries. As a side effect, setting the seconds to zero
will serialize mail to the domain.

#!/usr/bin/perl

use Fcntl ':flock';

$domain = lc $ARGV[0];

if (open(FD, "</var/qmail/control/remoteratelimit")) {
%ratelimit = map { s/[\r\n]+//; (split(/:/))[0,1] } <FD>;
$^F = fileno(FD);
close(FD);
}

if (defined($ratelimit{$domain})) {
$file = "/var/qmail/control/lastdelivery/$domain";
$exists = -s $file;
if (open(FD, "+<$file") || open(FD, "+>$file")) {
if (!flock(FD, LOCK_EX|LOCK_NB)) {
print "ZUnable to acquire lock\0";
exit 0;
}
if ($exists && time < (stat(FD))[9] + $ratelimit{$domain}) {
print "ZRatelimit exceeded\0";
exit 0;
}
print FD scalar localtime;
}
}

exec "/var/qmail/bin/qmail-remote.orig", @ARGV;


Rick.

Subject User Time
Is there a way to control the delivery rate? mailinglists at net-virtual Dec 16, 2004, 1:29 AM
    Re: Is there a way to control the delivery rate? kitchen at scriptkitchen Dec 16, 2004, 8:03 AM
    Re: Is there a way to control the delivery rate? qmail at discworld Dec 16, 2004, 8:18 AM
    Re: Is there a way to control the delivery rate? mailinglists at net-virtual Dec 16, 2004, 1:41 PM
    Re: Is there a way to control the delivery rate? mailinglists at net-virtual Dec 16, 2004, 1:41 PM
        Re: Is there a way to control the delivery rate? clive at messagecare Dec 16, 2004, 2:44 PM
            Re: Is there a way to control the delivery rate? clive at messagecare Dec 16, 2004, 3:36 PM
                Re: Is there a way to control the delivery rate? mailinglists at net-virtual Dec 16, 2004, 4:20 PM
                    Re: Is there a way to control the delivery rate? clive at messagecare Dec 16, 2004, 4:55 PM
        Re: Is there a way to control the delivery rate? qmail at discworld Dec 16, 2004, 3:21 PM
    Re: Is there a way to control the delivery rate? mailinglists at net-virtual Dec 16, 2004, 4:17 PM
        Re: Is there a way to control the delivery rate? safari-qmail at safari Dec 16, 2004, 5:03 PM
        Re: Is there a way to control the delivery rate? xistence at x-istence Dec 16, 2004, 5:27 PM
            Re: Is there a way to control the delivery rate? mailinglists at net-virtual Dec 16, 2004, 5:57 PM
                Re: Is there a way to control the delivery rate? lbudney at pobox Dec 16, 2004, 7:44 PM
                    Re: Is there a way to control the delivery rate? kitchen at scriptkitchen Dec 17, 2004, 9:39 AM
                Re: Is there a way to control the delivery rate? xistence at x-istence Dec 16, 2004, 7:51 PM
        Re: Is there a way to control the delivery rate? frob-qmail at webcentral Dec 16, 2004, 5:56 PM
        Re: Is there a way to control the delivery rate? kitchen at scriptkitchen Dec 17, 2004, 9:38 AM
    Re: Is there a way to control the delivery rate? mailinglists at net-virtual Dec 16, 2004, 6:02 PM
        Re: Is there a way to control the delivery rate? frob-qmail at webcentral Dec 16, 2004, 8:31 PM
    Re: Is there a way to control the delivery rate? mailinglists at net-virtual Dec 16, 2004, 8:06 PM
        Re: Is there a way to control the delivery rate? qmail at discworld Dec 17, 2004, 6:37 AM
    Re: Is there a way to control the delivery rate? kitchen at scriptkitchen Dec 17, 2004, 9:40 AM
    Re: Is there a way to control the delivery rate? mailinglists at net-virtual Dec 17, 2004, 3:01 PM
    Re: Is there a way to control the delivery rate? mjd at plover Mar 6, 2008, 12:19 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.