-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 14.2
-
Fix Version/s: 14.2.1
-
Component/s: None
-
Labels:None
-
Funded by:
When a user wants to change his email address in his profile no email is sent with the confirmation link. The cause is that in MailManagerImpl the code down if(!StringHelper.containsNonWhitespace(from)) (line 954) is never reached because the from address is filled by a real address. Therefore fromAddress is null which causes that the email is not sent. This is my suggestion:
diff --git a/src/main/java/org/olat/core/util/mail/manager/MailManagerImpl.java b/src/main/java/org/olat/core/util/mail/manager/MailManagerImpl.java index f90118f..89833dc 100644 --- a/src/main/java/org/olat/core/util/mail/manager/MailManagerImpl.java +++ b/src/main/java/org/olat/core/util/mail/manager/MailManagerImpl.java @@ -952,13 +952,13 @@ mail.setFrom(fromRecipient); } else { if(!StringHelper.containsNonWhitespace(from)) { - if (mimeFromAddress != null) { - from = mimeFromAddress.getPersonal(); - fromAddress = mimeFromAddress; - } else { - from = WebappHelper.getMailConfig("mailFrom"); - fromAddress = createFromAddress(from, result); - } + from = WebappHelper.getMailConfig("mailFrom"); + } + if (mimeFromAddress != null) { + from = mimeFromAddress.getPersonal(); + fromAddress = mimeFromAddress; + } else { + fromAddress = createFromAddress(from, result); } DBMailRecipient fromRecipient = new DBMailRecipient(); fromRecipient.setEmailAddress(from);