Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Controlling e-mails sent per hour

by rob_au (Abbot)
on Feb 06, 2004 at 05:26 UTC ( #326998=note: print w/replies, xml ) Need Help??

in reply to Controlling e-mails sent per hour

One change which I would make would be the following which implements a variable sleep such that the sending of mail is more evenly timed to match 15 second intervals - I have used something similar for a dispatch of mail to our (many thousand) local users in order to stagger the load on the mail server.

eval "use Time::HiRes qw( time sleep )"; foreach (@{ $userinfo }) { my $time = time(); ... sleep 15 - ((time() - $time) % 15); }

However, if you are employing sendmail as a local MTA, you may be interested in taking a look at vthrottle which is a rate throttling mechanism for Sendmail implemented via the milter interface (which can also be interfaced in Perl by way of Sendmail::Milter or PMilter). This may constitute a longer term solution for your mail throttling.


perl -le "print unpack'N', pack'B32', '00000000000000000000001011000000'"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://326998]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2018-05-27 01:27 GMT
Find Nodes?
    Voting Booth?