Smtp

Graylog 電子郵件警報密碼不起作用?

  • October 25, 2021

我最近更改了我的 gmail 密碼並更改了 server.conf 中的密碼,但現在 graylog 的電子郵件警報失敗並顯示:

Sending the email to the following server failed : smtp.gmail.com:587 (javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials h12sm2292608qkp.52 - gsmtp )

以下是 server.conf 中的電子郵件條目:

transport_email_enabled = true
transport_email_hostname = smtp.gmail.com
transport_email_port = 587
transport_email_use_auth = true
transport_email_use_tls = true
transport_email_auth_username = myemail@gmail.com
transport_email_auth_password = Fake!@$#%^&*()"password
transport_email_subject_prefix = [Log-Alerts]
transport_email_from_email = logs@domain.com

Web gui 中的警報配置中的設置也相同。

我知道使用者名、電子郵件、埠、伺服器和 tls 選項是正確的,因為 zabbix(託管在同一台伺服器上)能夠完全正常地向我的 gmail 發送電子郵件。

我擔心我的新密碼包含特殊字元,!@#$%^&*"導致 server.conf 出錯並且讀取密碼錯誤。

有沒有辦法將 server.conf 中的密碼欄位改為外部文件?Graylog 在其文件中的任何地方都沒有提到這一點。

在配置文件的開頭,我們可以閱讀以下內容:

# This is the Graylog configuration file. The file has to use ISO 8859-1/Latin-1 character encoding.
# Characters that cannot be directly represented in this encoding can be written using Unicode escapes
# as defined in https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.3, using the \u prefix.
# For example, \u002c.

因此,請仔細檢查您密碼中的每個字元是否列在ISO/IEC 8859-1程式碼頁中。否則,您將不得不逃脫它們。如有疑問,請避開字元。

引用自:https://serverfault.com/questions/1081661