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?

1 Answer 1


You must follow RFC 5321 which explicitly states how to implement Retry Strategies: https://www.rfc-editor.org/rfc/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!

  • 3
    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, 2012 at 11:23

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.