diff options
author | Anton Tananaev <anton@traccar.org> | 2023-03-16 09:55:19 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-03-16 09:55:19 -0700 |
commit | d4816aae87600334fe798e8b50b9f11df6f0b293 (patch) | |
tree | 1882a5335a653a63136b795df6661d988d33d3e7 /src/main/java/org/traccar/mail/SmtpMailManager.java | |
parent | 5c0962c257d51bef081d25405c972dd54035a0b2 (diff) | |
download | trackermap-server-d4816aae87600334fe798e8b50b9f11df6f0b293.tar.gz trackermap-server-d4816aae87600334fe798e8b50b9f11df6f0b293.tar.bz2 trackermap-server-d4816aae87600334fe798e8b50b9f11df6f0b293.zip |
Option for system only emails
Diffstat (limited to 'src/main/java/org/traccar/mail/SmtpMailManager.java')
-rw-r--r-- | src/main/java/org/traccar/mail/SmtpMailManager.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/mail/SmtpMailManager.java b/src/main/java/org/traccar/mail/SmtpMailManager.java index 4a0b7048f..8d1afbd3e 100644 --- a/src/main/java/org/traccar/mail/SmtpMailManager.java +++ b/src/main/java/org/traccar/mail/SmtpMailManager.java @@ -93,19 +93,21 @@ public final class SmtpMailManager implements MailManager { return config.hasKey(Keys.MAIL_SMTP_HOST); } + @Override public void sendMessage( - User user, String subject, String body) throws MessagingException { - sendMessage(user, subject, body, null); + User user, boolean system, String subject, String body) throws MessagingException { + sendMessage(user, system, subject, body, null); } + @Override public void sendMessage( - User user, String subject, String body, MimeBodyPart attachment) throws MessagingException { + User user, boolean system, String subject, String body, MimeBodyPart attachment) throws MessagingException { Properties properties = null; if (!config.getBoolean(Keys.MAIL_SMTP_IGNORE_USER_CONFIG)) { properties = getProperties(new PropertiesProvider(user)); } - if (properties == null) { + if (properties == null && (system || !config.getBoolean(Keys.MAIL_SMTP_SYSTEM_ONLY))) { properties = getProperties(new PropertiesProvider(config)); } if (properties == null) { |