mirror of https://github.com/shred/acme4j
Fix NPE if Auto-Submitted header is missing
parent
30a9b53746
commit
9115dc743f
|
@ -305,12 +305,13 @@ public final class EmailProcessor {
|
|||
* @return {@code true} if the mail was auto-generated.
|
||||
*/
|
||||
private boolean isAutoGenerated(Message message) throws MessagingException {
|
||||
for (String header : message.getHeader("Auto-Submitted")) {
|
||||
if (header.trim().startsWith("auto-generated")) {
|
||||
return true;
|
||||
}
|
||||
String[] autoSubmitted = message.getHeader("Auto-Submitted");
|
||||
if (autoSubmitted == null) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return Arrays.stream(autoSubmitted)
|
||||
.map(String::trim)
|
||||
.anyMatch(h -> h.startsWith("auto-generated"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue