Skip to content
Permalink
Browse files

[JENKINS-16181] Jenkins does not try to resend a failed e-mail

- Added handling where MessagingConnection is caused by a ConnectException. One retry with a delay of 10 sec is made.
  • Loading branch information
christiangalsterer committed Aug 23, 2014
1 parent 5a0f29b commit 531a9232658a3bb725be1f0551a1bb01ec30c588
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
@@ -385,6 +385,14 @@ private boolean sendMail(ExtendedEmailPublisherContext context) {
debug(context.getListener().getLogger(), "SendFailedException message: " + e.getMessage());
break;
}
} catch (MessagingException e) {
if (e.getNextException() != null && (e.getNextException() instanceof ConnectException)) {
context.getListener().getLogger().println("Connection error sending email, retrying once more in 10 seconds...");
Thread.sleep(10000);
} else {
debug(context.getListener().getLogger(), "MessagingException message: " + e.getMessage());
break;
}
}
retries++;
if (retries > 1) {

0 comments on commit 531a923

Please sign in to comment.
You can’t perform that action at this time.