Setting up email for alerts

having this issue, using gmail. Could it be that if I change to office365 it’d work?

my config:

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_use_ssl = false
transport_email_auth_username = email
transport_email_auth_password = password
transport_email_subject_prefix = [graylog]
transport_email_from_email = graylog@example.com

My Error is: An error occurred while trying to send an email! (triggered 9 minutes 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 : smtp.gmail.com:587 (com.sun.mail.util.MailConnectException: Couldn’t connect to host, port: smtp.gmail.com, 587; timeout 60000; nested exception is: java.net.SocketTimeoutException: connect timed out)

Tried to telnet to smtp.gmail.com 587 but nothing

I don’t know if this will solve your issue but in “transport_email_from_email =”, I used the same address that is in “transport_email_auth_username =”.

Also is there any firewall that can block the outgoing traffic?

thanks for the response, I had changed that to the auth email but still nothing. I too think it might the firewall blocking outgoing traffic.

Try to test the destination port with a tool, no doubt after that.

nc -zv smtp.gmail.com 587

just search in this community - How to send email alerts using Gmail - should guide you.

Hey,
So, I’ve been speaking to my IT team because initially I believed we had to use the company’s mail server. So we have been working on that, but I am still getting error. This is the error we I am currently getting:

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 : smtp.intra.COMPANY.local:25 (com.sun.mail.util.MailConnectException: Couldn’t connect to host, port: smtp.intra.COMPANY.local, 25; timeout 60000; nested exception is: java.net.UnknownHostException: smtp.intra.COMPANY.local)

Firewall is configured, and it worked at system level. I believe it could be on the application end. Does anybody have a clue of what it might be?

you should check if the name and port are correct:

Couldn’t connect to host, port: smtp.intra.COMPANY.local, 25;

Thanks for replying. Yes, it is correct.

something between the Graylog System (master) and the Mailserver then is blocking the access. That is the error message.

How could I go on about checking this?
As far as I know the graylog server to mail server connectivity is fine:

root@RSH-TEST-GRLOG:/etc/graylog/server# telnet IP 25

Trying IP...

Connected to IP.

Escape character is '^]'.

220 S-EXCH-HYB02.intra.COMPANY.local Microsoft ESMTP MAIL Service ready at Fri, 28 Sep 2018 11:20:43 +0100

Apparently, I just fixed that issue. It came back to this other issue:

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 : IP:PORT (javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful )

I have whitelisted everything necessary.

535 5.7.3 Authentication unsuccessful

you provided the wrong user or password

the user and password is correct though.

that is something I can’t check - I only interpret the systems error message. You are the only person that can verify and solve this.

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