linden06
(Linden)
June 1, 2018, 9:38pm
1
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!
jochen
(Jochen)
June 2, 2018, 10:45am
2
My spider sense is tingling…
linden06
(Linden)
June 2, 2018, 10:59am
3
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?
jochen
(Jochen)
June 2, 2018, 3:01pm
4
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.
linden06
(Linden)
June 2, 2018, 8:14pm
5
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?
jochen
(Jochen)
June 3, 2018, 8:48pm
6
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.
linden06
(Linden)
June 9, 2018, 1:22pm
7
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!
jan
(Jan Doberstein)
June 10, 2018, 11:34am
8
why not search in the community for a solution?
Sending email alerts
Because I know it’s not obvious from the interface and the documentation is vague, I’m writing this tutorial to document the process for configuring the email settings for Graylog and for configuring alerts to be sent via email. I’m using CentOS7 as a base, so instructions will differ if you’re using the OVA or another distribution. Configuration is also for Gmail as that is our email provider, so adapt to your own service where necessary.
Configure graylog server
Firstly…
system
(system)
Closed
June 24, 2018, 11:34am
9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.