Graylog – Email Alert Password Not Working

graylogsmtp

I recently changed my gmail password and changed the password in server.conf as well, but now graylog's email alerting fails with:

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 )

Here are the email entries in 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 = [email protected]
transport_email_auth_password = Fake!@$#%^&*()"password
transport_email_subject_prefix = [Log-Alerts]
transport_email_from_email = [email protected]

The settings are the same in the alert config in the web gui as well.

I know the username, email, port, server, and tls options are correct, as zabbix (hosted on the same server) is able to send emails to my gmail completely fine.

I am concerned that my new password containing special characters, !@#$%^&*" is tripping up the server.conf and it is reading the password wrong.

Is there a way to give the password field in server.conf an external file instead? Graylog does not mention this anywhere in their documentation.

Best Answer

At the beggining of the configuration file, we can read the following:

# 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.

So, double check that each chars in your password are listed in the ISO/IEC 8859-1 code page. Otherwise, you'll have to escape them. When in doubt, escape the char.