-
-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SAK-50284 Kernel email Message-ID must contain angle brackets #12720
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d253fde
SAK-50284 Message-ID must contain angle brackets
ottenhoff c975092
add debug log to ignored exception
ern 7db8857
Update BasicEmailService.java
ottenhoff b03ae6b
Update kernel/kernel-impl/src/main/java/org/sakaiproject/email/impl/B…
adrianfish 73bca70
Update kernel/kernel-impl/src/main/java/org/sakaiproject/email/impl/B…
adrianfish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1343,7 +1343,9 @@ protected void sendMessageAndLog(InternetAddress[] to, long start, MimeMessage m | |
buf.append(" with ").append(parts.getCount() - 1).append(" attachments"); | ||
} | ||
} | ||
catch (IOException ioe) {} | ||
catch (IOException ioe) { | ||
log.debug("could not read message contents, {}", ioe); | ||
} | ||
|
||
if (log.isDebugEnabled()) | ||
{ | ||
|
@@ -1608,9 +1610,9 @@ else if (canUseCharset(message, CharacterSet.WINDOWS_1252) && canUseCharset(getS | |
/** | ||
* Override MimeMessage Message-ID to use Sakai serverId instead of hostname | ||
* https://javaee.github.io/javamail/FAQ#msgid | ||
* @throws MessagingException | ||
*/ | ||
protected void updateMessageID() throws MessagingException | ||
*/ | ||
@Override | ||
protected void updateMessageID() throws MessagingException | ||
{ | ||
StringBuilder s = new StringBuilder(); | ||
// Unique string is <hashcode>.<id>.<currentTime><suffix> | ||
|
@@ -1621,10 +1623,11 @@ protected void updateMessageID() throws MessagingException | |
append(System.currentTimeMillis()). | ||
append('@'). | ||
append(serverConfigurationService.getServerName()); | ||
setHeader("Message-ID", s.toString()); | ||
setHeader("Message-ID", "<" + s + ">"); | ||
} | ||
|
||
protected void updateHeaders() throws MessagingException | ||
@Override | ||
protected void updateHeaders() throws MessagingException | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spacing |
||
{ | ||
super.updateHeaders(); | ||
if (m_id != null) | ||
|
@@ -1672,17 +1675,12 @@ private void addEncodedHeader(String header, String name) throws MessagingExcept | |
} | ||
} | ||
} | ||
catch (MessagingException e) | ||
{ | ||
log.error("Email.MyMessage: exception: " + e, e); | ||
addHeaderLine(header); | ||
} | ||
catch (UnsupportedEncodingException e) | ||
catch (MessagingException | UnsupportedEncodingException e) | ||
{ | ||
log.error("Email.MyMessage: exception: " + e, e); | ||
log.error("Email.MyMessage: exception: {}", e, e); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spacing |
||
addHeaderLine(header); | ||
} | ||
} | ||
} | ||
} | ||
|
||
public String propName(String propNameTemplate) | ||
|
@@ -1692,7 +1690,6 @@ public String propName(String propNameTemplate) | |
|
||
public String propName(String propNameTemplate, String protocol) | ||
{ | ||
String formattedName = String.format(propNameTemplate, protocol); | ||
return formattedName; | ||
return String.format(propNameTemplate, protocol); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spacing |
||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing