0

i have sendmail, and i am sending mailshot every week. how can i tell my sendmail to limit the number of outgoing emails to a specific domain per hour (to avoid getting blocked by mail servers) for example: to send 500 email/hour at most to @yahoo.com and the same for @gmail.com and so on

Thanks for your help

2

The best way to solve the problem is to use something like milter-limit which is desgined specifically to throttle messages and can do this on a per-domain limit

1

Use two separate instances of sendmail, one to acceppt your messages and queue them. It must not be configured to deliver these mails.

The Second instance in fact will be set to deliver the mails to the corresponding recipients - but wont have something to do intially.

Set the queue processing on Instance 2 to

QUEUE_MODE="cron"
QUEUE_INTERVAL="1h"

Now using an external CRONned script run through the queue of Instance 1 and copy 500 Messages that match your other criteria over to Instance 2's queue. Most likely it would be a good idea to make sure the Cron-Script runs before the Queue is processed.

  • This is a scary bad way to solve the problem. – symcbean Nov 4 '10 at 16:28
  • I think that's a trifle harsh. Systems running two sendmails, one of which only queues, the other of which only processes the queue, and a third process moves mails from one queue to the other, aren't unknown. MailScanner comes to mind, and that's hardly belt-and-braces software. But I agree with you that milter-limit is much more elegant. – MadHatter supports Monica Nov 4 '10 at 16:33
  • milter-limit is a way more elegant solution than my proposal. Learned something new - yay – pacey Nov 4 '10 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.