-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Edd Grant opened SPR-7245 and commented
When sending email in JavaMailSenderImpl, in the event that there are any failed messages the doSend() method includes a Map<MimeMessage, Exception> in the raised MailSendException. This is particularly useful as it allows the caller to identify exactly which emails have failed taking the appropriate action only for those emails.
However if a network problem occurs part way through a send (let's say the socket is closed abnormally) then the MailSendException that is thrown only contains the exception (in this case a SocketException) which has caused the failure.
It would be very useful if the messages which were not sent could be added to the failedMessages Map of the thrown MailSendException along with the causing exception. This would allow the caller to take the appropriate action (which in the case of a network failure might be a delayed retry) for only those messages which were underlivered.
Cheers,
Edd
Affects: 2.5.6
Referenced from: commits 433b4ef