Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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

share|improve this answer

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.

share|improve this answer
    
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 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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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