Implementing a Poll for the Mail Queue

Dennis Faas's picture

With respect to the title of this newsletter: you might be wondering, "What the heck is a poll?" -- better yet, what is a "mail queue?&quo t;

Those are definitely good questions. A poll (in computer lingo) is responsible for sending the computer a special request -- usually at a specific time frame. A mail queue is a place where emails are deposited on a computer (for example, a web server) where it awaits to be sent or resent at a later time.

How it all Works

Whenever I send out the Gazette newsletter, some emails don't get through to their destination. These emails are then put into the infopackets web server mail queue and are tried again at a later time. Here are some reasons why emails get stuck in the queue:

  1. The destination is full and the newsletter is rejected;
  2. There is an error reaching the web server while delivering the email (a timeout), or
  3. The email box no longer exists.

At any rate, you can imagine that with 30,000 people on the Gazette newsletter list, there's a lot of mails that get stuck in the queue. That eats up a lot of space on the web server.

Yesterday, I made a configuration change which caused about 10,000 emails to get stuck on the infopackets web server mail queue. The server eventually ran out of space and everything got messed up (to say the least).

I spent most of my day trying to resolve the problem.

In fact, I went a step beyond that and wrote my own "mail queue polling" program that will poll the mail queue for every 500 newsletters which are sent, in order to ensure that the server hasn't run out of space. If there's too many emails that are jammed in the queue, the newsletter mailing program will pause and wait for the messages to be dispersed from the queue before attempting to send any more messages.

I only gave this program a theoretical test today (obviously, since this newsletter wasn't written at the time). By tomorrow I should know if it worked or not.

PS: If you didn't get to read yesterday's issue of the Gazette, read it online! The feature article is a must read!

Rate this article: 
No votes yet