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

I'm configuring a custom made mail queue. The thing is there can be errors sending mail. Normally, one won't know the reason why the mail didn't reach it's destination. So the most simplistic solution is to try to send the mail again. Here are some algorithms i know from mouth:

  • Duplicate the time in queue for next retry starting at some time: 1 min, 2 min, 4 min, etc.
  • Specify a series of intervals (which are a general case of the previous option): 5 min, 5 min, 10 min, 30 min, etc.

At some point it'll be pointless to try sending the mail again. Anyway, the system includes a log for non-sent mail.

What do you know about good practices round this matter? What is a "good" hold interval? At least, which facts should i take in account to choose the intervals?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You must follow RFC 5321 which explicitly states how to implement Retry Strategies: http://tools.ietf.org/html/rfc5321#section-4.5.4

You have to completely read (and understand!) this RFC when you are trying to implement your own mail server. But I have to explicitly stress that there is almost no need to implement your own mail server (client). There are plenty of already existing (tested!) solutions which are productive for years and decades. So use existing software instead of starting from scratch. It is not worth the trouble you will run into. Are you even aware of IPv6? If not you should!

share|improve this answer
1  
There is no hard obligation to stick to RFCs of course, but it is highly advisable if the system needs to work on the internet some day. While there might be reasons to implement an own mail queue, I fully agree that existing code used in mail server software should be reused instead of re-inventing the wheel. –  the-wabbit Jan 9 '12 at 11:23

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.