diff --git a/pom.xml b/pom.xml index d05ed31..6c55664 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.massaro Email - 2.9.5 + 2.9.6 org.springframework.boot diff --git a/src/main/java/email/model/Message.java b/src/main/java/email/model/Message.java index 6aec322..fb607d2 100644 --- a/src/main/java/email/model/Message.java +++ b/src/main/java/email/model/Message.java @@ -93,7 +93,7 @@ public Message(javax.mail.Message message, this.fromAddress = sender.getAddress(); this.fromPersonal = sender.getPersonal(); } - if (obfuscateAmazonOrderSubject && (this.fromAddress.equalsIgnoreCase("shipment-tracking@amazon.com") || this.subject.toLowerCase().contains("your amazon.com order of \""))) { + if (obfuscateAmazonOrderSubject && ("shipment-tracking@amazon.com".equalsIgnoreCase(this.fromAddress) || (this.subject != null && this.subject.toLowerCase().contains("your amazon.com order of \"")))) { this.subject = subject.replaceAll("\"(.*?)\"", "*****"); } javax.mail.Address[] recipients = message.getRecipients(javax.mail.Message.RecipientType.TO);