1

I am using qmail to send a large number of emails on behalf of many people. It varies between 400k and 600k emails per job.

A php script queues up all of the messages, which takes a few hours. The messages then take about 24-48 hours to dequeue and get sent.

The length of time is not a problem, but I do not like that emails are sent at odd times (like in the middle of the night, or at sunrise).

Is there a way I can tell qmail to only dequeue messages only during a certain time range?

For example, tell it to only empty the queue between 6AM and 8PM, then just let it "sleep" after 8PM until 6AM the next day to finish the queue.

Using CentOS 6.6 Final

1 Answer 1

2

The command qmailctl pause will pause qmail, and qmailctl cont will unpause.

If that's too much, a look at the source show this:

pause)
  echo "Pausing qmail-send"
  svc -p /service/qmail-send
  echo "Pausing qmail-smtpd"
  svc -p /service/qmail-smtpd
  ;;

Doing svc -p /service/qmail-send should prevent qmail from sending, and then svc -c /etc/service/qmail-send to go back to normal. You could use a cron job to perform these actions at times of your choosing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .