JOIN GRAYLOG FOR OUR

ANNUAL CONFERENCE

Thursday,
October 21, 2021
10am-5pm CT
REGISTER NOW

Setting up Email Transport Config

I’m trying to set up the email transport configuration for sending alerts, but I’ve been getting this error:

An error occurred while trying to send an email! (triggered 2 hours ago)
The Graylog server encountered an error while trying to send an email. This is the detailed error message: org.apache.commons.mail.EmailException: Sending the email to the following server failed : mail.mycorp.com:587 (javax.mail.MessagingException: Could not connect to SMTP host: mail.mycorp.com, port: 587; nested exception is: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?)

On a telnet test:

telnet mail.mycorp.com 587

returns

Trying 172.10.20.50...
Connected to mail.mycorp.com 

Here’s my config for the root email,

root_email = "alert@mycorp.com"

and the email transport:

transport_email_enabled = true
transport_email_protocol = smtp
transport_email_hostname = mail.mycorp.com
transport_email_port = 587
transport_email_use_auth = true
transport_email_use_tls = false
transport_email_use_ssl = false
transport_email_auth_username = alert
transport_email_auth_password = #alert@mycorp.com password here#
transport_email_subject_prefix = [graylog2]
transport_email_from_email = alert@mycorp.com 
transport_email_from_name = Graylog2
transport_email_web_interface_url = http://172.10.20.100:9000

I’ve allowed ports 25/tcp and 587/tcp in the firewall, and tried setting transport_email_port = 25, but the error is still the same.

Help is much appreciated!

My spider sense is tingling… :spider:

Setting both of the following options:

transport_email_use_tls = false
transport_email_use_ssl = true

and

transport_email_use_tls = true
transport_email_use_ssl = true

return the same error:

Unrecognized SSL message Preformatted text, plaintext connection?

Could this be that my config for transport_email_auth_password is in plaintext?

No. The password has to be plaintext in the configuration file.

It really depends on what your SMTP server expects.

transport_email_use_ssl will use an SMTP connection over SSL (SMTPS), typically on port 465/tcp, and transport_email_use_tls will use an SMTP connection with a TLS connection upgrade via STARTTLS, typically on port 587/tcp.

While you can enable both, it doesn’t make sense in most cases.

I don’t think my mail server has an issue, as it has been working for nearly a year now. My mail server uses TLS on port 587, so transport_email_use_tls = true should be the only change I need to my config, right?

Where else in my config should I look to resolve my issue?

I didn’t say that. I just said, your configuration has to be appropriate to what your SMTP server expects.

For example, it doesn’t expect the connection to be started over SSL.

I’ve verified that my mail server also has the option of using Gmail as its SMTP server. The following config is now working for me:

transport_email_enabled = true
transport_email_protocol = smtp
transport_email_hostname = smtp.gmail.com
transport_email_port = 587
transport_email_use_auth = true
transport_email_use_tls = true
transport_email_use_ssl = false
transport_email_auth_username = alert@mycorp.com
transport_email_auth_password = #alert@mycorp.com password here#
transport_email_subject_prefix = [graylog2]
transport_email_from_email = alert@mycorp.com 
transport_email_from_name = Graylog2
transport_email_web_interface_url = http://172.10.20.100:9000

Thanks for your assistance!

1 Like

why not search in the community for a solution?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.