Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to improve email sending and delivery reliability?

The current application uses Simple Java Mail to send couple emails a day but some of the emails never make it to the client.

Based on the application server logs there has been couple mail server time outs but that does not explain all the cases of the missing emails. Adding a retry feature would help with the time out problem but are there any other approaches to improve email reliability in general?

like image 756
Petteri H Avatar asked Jan 25 '10 10:01

Petteri H


1 Answers

It's the nature of SMTP that it does not implement transactional integrity.

About 6 years ago I did quite a detailled analysis of why mails from the company I was working at then were failing. I could only see as far as the receiving MTA, but this showed a very strong correlation between the type of MTA and the failure rate (at that time, Novell Groupwise and Sendmail at the remote end were the most reliable, MSExchange the least, with qmail and others in the middle). Note that this was highly empirical and may have reflected product choice vs available skills rather than intrinsic problems in specific MTAs - and its rather out of date now. Also, its not something you can effectively control.

Although, since you've got the opportunity to develop and implement your own logic on top of the MTA, there is no guarantee that:

1) if a message fails after leaving your MTA you will get any bounce notification back

2) if you send a message with a DSN request (see RFC 1891) that the remote system will actually send back the DSN

The most important things you can do to improve deliverability is to know a lot about SMTP, maintain your own MTA and configure it accordingly. One of the key problems these days is that everyone's trying to stop spam - and everyone's got their own method of doing that. And usually they won't tell you the recipe for their secret sauce. Indeed, with bayesian filtering, they may not even know!

I guess the next port of call (after you've checked your SPF is restrictive and published, and that you're not RBL'd) would be to look at how you establish if your mail is getting delivered - as I said, you can't rely on DSNs. Not can you rely on bugging your emails (e.g. by sending them out as HTML with, e.g. ) since most MUAs will not load remote content (again to prevent spam). Which just leaves the option of keeping the content serverside and sending out a clickable link to the original content. But this again assumes that your recipients always want to read your message.

C.

like image 125
symcbean Avatar answered Sep 28 '22 09:09

symcbean