summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodulserver')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/mail/SmtpMailer.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/mail/SmtpMailer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/mail/SmtpMailer.java
index d7859f3c..c2faef9a 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/mail/SmtpMailer.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/mail/SmtpMailer.java
@@ -76,8 +76,15 @@ public class SmtpMailer {
if (!client.elogin("bwlehrpool.sat")) {
throw new LoginException("SMTP server rejected EHLO");
}
- if (ssl == EncryptionMode.EXPLICIT && !client.execTLS()) {
- throw new LoginException("STARTTLS (explicit TLS) failed");
+ if (ssl == EncryptionMode.EXPLICIT) {
+ if (!client.execTLS()) {
+ throw new LoginException("STARTTLS (explicit TLS) failed");
+ }
+ // Not checking result of this. We SHOULD do this according to RFC2487, and didn't previously, which
+ // worked fine for a long time. Now we stumbled upon a gateway that REQUIRES another EHLO after
+ // STARTTLS. If for some reason this fails, it might still be a valid session from the first EHLO
+ // I guess, so just try to keep going until something else breaks. :-/
+ client.elogin("bwlehrpool.sat");
}
if (!Util.isEmptyString(username)) {
boolean authed = false;