[New] SmtpMailer now understands whitelists for override
This commit is contained in:
parent
58248058e5
commit
a618fff095
|
@ -97,11 +97,11 @@ public class SmtpMailer {
|
||||||
String fromName = properties.getProperty("fromName", null);
|
String fromName = properties.getProperty("fromName", null);
|
||||||
this.from = new InternetAddress(fromAddr, fromName);
|
this.from = new InternetAddress(fromAddr, fromName);
|
||||||
|
|
||||||
if (properties.containsKey("overrideRecipients")) {
|
if (!properties.containsKey("overrideRecipients")) {
|
||||||
|
this.overrideRecipients = null;
|
||||||
|
} else {
|
||||||
String addr = properties.getProperty("overrideRecipients", null);
|
String addr = properties.getProperty("overrideRecipients", null);
|
||||||
this.overrideRecipients = InternetAddress.parse(addr);
|
this.overrideRecipients = InternetAddress.parse(addr);
|
||||||
} else {
|
|
||||||
this.overrideRecipients = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!properties.containsKey("recipientWhitelist")) {
|
if (!properties.containsKey("recipientWhitelist")) {
|
||||||
|
@ -179,8 +179,11 @@ public class SmtpMailer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!allowList.isEmpty()) {
|
if (!allowList.isEmpty()) {
|
||||||
send(subject, text, parseAddress(recipients));
|
InternetAddress[] arr = new InternetAddress[allowList.size()];
|
||||||
logger.info(MessageFormat.format("Sent E-mail to {0}: {1}", recipients, subject));
|
allowList.toArray(arr);
|
||||||
|
send(subject, text, arr);
|
||||||
|
logger.info(
|
||||||
|
MessageFormat.format("Sent E-mail to white list recipient {0}: {1}", recipients, subject));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needsOverrides) {
|
if (needsOverrides) {
|
||||||
|
|
Loading…
Reference in New Issue