Skip to content

Commit fff2b90

Browse files
committed
https://github.com/scouter-project/scouter-plugin-server-alert-email/issues/12
1 parent a219395 commit fff2b90

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* **_ext\_plugin\_email\_level_** : 수신 레벨(0 : INFO, 1 : WARN, 2 : ERROR, 3 : FATAL) - 기본 값은 0
2020
* **_ext\_plugin\_email\_smtp_hostname_** : SMTP 서버의 IP 또는 Domain - 기본 값은 smtp.gmail.com
2121
* **_ext\_plugin\_email\_smtp_port_** : SMTP Port - 기본 값은 587
22+
* **_ext\_plugin\_email\_smtpauth_enabled_** : SMTP 인증 사용 여부 - 기본 값은 true
2223
* **_ext\_plugin\_email\_username_** : Email 사용자 계정
2324
* **_ext\_plugin\_email\_password_** : Email 사용자 비밀번호
2425
* **_ext\_plugin\_email\_ssl_enabled_** : SSL 사용 여부 - 기본 값은 true
@@ -42,6 +43,7 @@ ext_plugin_email_debug=true
4243
ext_plugin_email_level=0
4344
ext_plugin_email_smtp_hostname=smtp.gmail.com
4445
ext_plugin_email_smtp_port=587
46+
ext_plugin_email_smtpauth_enabled=true
4547
ext_plugin_email_username=noreply@scouter.com
4648
ext_plugin_email_password=password
4749
ext_plugin_email_ssl_enabled=true

src/scouter/plugin/server/alert/email/EmailPlugin.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public void run() {
120120
// Get server configurations for email
121121
String hostname = conf.getValue("ext_plugin_email_smtp_hostname", "smtp.gmail.com");
122122
int port = conf.getInt("ext_plugin_email_smtp_port", 587);
123+
boolean authEnabled = conf.getBoolean("ext_plugin_email_smtpauth_enabled", true);
123124
String username = conf.getValue("ext_plugin_email_username");
124125
String password = conf.getValue("ext_plugin_email_password");
125126
boolean sslEnabled = conf.getBoolean("ext_plugin_email_ssl_enabled", true);
@@ -219,7 +220,9 @@ public void run() {
219220
email.setSmtpPort(port);
220221
}
221222

222-
email.setAuthenticator(new DefaultAuthenticator(username, password));
223+
if (authEnabled) {
224+
email.setAuthenticator(new DefaultAuthenticator(username, password));
225+
}
223226
email.setStartTLSEnabled(tlsEnabled);
224227
email.setFrom(from);
225228
email.setSubject(subject);

0 commit comments

Comments
 (0)