Java – how to improve the reliability of e-mail sending and delivery?
Current applications use simple java mail to send several emails a day, but some emails will never be sent to the client
According to the application server log, several mail servers have timed out, but this does not explain all lost e-mail Adding retry can help solve the timeout problem, but is there any other way to improve the reliability of e-mail?
Solution
The essence of SMTP is that it does not implement transaction integrity
About six years ago, I made a detailed analysis of why the emails of the company I worked for at that time failed I can only see receiving MTA, but this shows a very strong correlation between MTA type and failure rate (at that time, Novell GroupWise and sendmail on the remote side were the most reliable, msexchange was the least, qmail and others in the middle) Please note that this is highly empirical and may reflect the comparison of product selection with available skills rather than inherent problems in a specific MTA – it is now obsolete Besides, it's not something you can effectively control
Although, since you have the opportunity to develop and implement your own logic on top of MTA, there is no guarantee that:
1) If the email fails after leaving your MTA, you will receive any return notification
2) If you send a message with a DSN request (see RFC 1891), the remote system will actually send it back to the DSN
The most important thing you can do is to improve transitivity, learn a lot about SMTP, maintain your MTA and configure it accordingly One of the key issues these days is that everyone is trying to stop spam - everyone has their own way to do it And usually they don't tell you the recipe of the secret sauce In fact, they may not even know about Bayesian filtering!
I think the next stop (after you check your SPF, it is restrictive and published, and you don't have RBL) will see how you can determine whether your mail has been delivered - as I said, you can't rely on DSN You can't rely on eavesdropping e-mail (for example, by sending it out as HTML, for example) because most MUAs don't load remote content (again, prevent spam) This allows you to keep the content server and send a clickable link to the original content But this assumes that your recipients always want to read your messages
C.