# Notification has email recipients and is triggered, but sending emails failed. Sending the email to the following server failed : mustafa.local:587

**URL:** <https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788>\
**Category:** Graylog Central (peer support)\
**Tags:** alert\
**Created:** [December 6, 2022, 12:25pm UTC](https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788 "2022-12-06T12:25:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mustafa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/mustafa/32/13708_2.png) [@mustafa](https://community.graylog.org/u/mustafa)\
**Post date:** [December 6, 2022, 12:25pm UTC](https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788/1 "2022-12-06T12:25:39Z")

</div>

Hi,  
I install the graylog and I got the logs. After that I want to send Email from the Graylog about this logs, but I can’t

I opened the TCP/25 and TCP/587 ports but it doesn’t worked. I am sharing the files below this case.

```auto
root@mustafa:/home/mustafa# telnet IP ADDRESS 587
Trying IP ADDRESS...
Connected to IP ADDRESS.
Escape character is '^]'.

root@mustafa:/home/mustafa# telnet IP ADDRESS 25
Trying IP ADDRESS...
Connected to IP ADDRESS.
Escape character is '^]'.

```

graylog/server/server.conf file:

```auto

# Email transport
transport_email_enabled = true
transport_email_hostname = mustafa.local
transport_email_port = 587
transport_email_use_auth = true
transport_email_use_tls = true
transport_email_use_ssl = false
transport_email_auth_username = alert
transport_email_auth_password = server
transport_email_auth_prefix = [graylog]
transport_email_web_interface_url = http://IP ADDRESS:9000
transport_email_from_email = alert@mustafa.local

```

Postfix File :  
/etc/postfix/main.cf

```auto
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level=may

smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mustafa.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, mustafa, localhost.localdomain, , localhost
relayhost =
mynetworks = 10.X.X.X/24 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

masquerade_domains = mustafa.local

```

The Logs:

```auto
journalctl -xe | grep -i graylog

Dec 06 14:40:23 mustafa graylog-server[133941]: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Dec 06 14:40:24 mustafa graylog-server[133941]: WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
Dec 06 14:40:27 mustafa graylog-server[133941]: WARNING: An illegal reflective access operation has occurred
Dec 06 14:40:27 mustafa graylog-server[133941]: WARNING: Illegal reflective access by retrofit2.Platform (file:/usr/share/graylog-server/graylog.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
Dec 06 14:40:27 mustafa graylog-server[133941]: WARNING: Please consider reporting this to the maintainers of retrofit2.Platform
Dec 06 14:40:27 mustafa graylog-server[133941]: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
Dec 06 14:40:27 mustafa graylog-server[133941]: WARNING: All illegal access operations will be denied in a future release
Dec 06 14:40:47 mustafa graylog-server[133941]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
Dec 06 14:40:47 mustafa graylog-server[133941]: SLF4J: Defaulting to no-operation (NOP) logger implementation
Dec 06 14:40:47 mustafa graylog-server[133941]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

```

In addition I have the same issue with port 465 too

Thanks in advance

---

<div class="post-metadata">

**Author:** ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)\
**Post date:** [December 6, 2022, 10:55pm UTC](https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788/2 "2022-12-06T22:55:25Z")

</div>

Hey @mustafa && Welcome

Not 100% sure what the issue is, but for troubleshooting purposes try using port 25 (i.e., localhost). ensure the port is opened on the firewall, and if you have **SELinux/Apparmor** enable check that.

You may want to post logs from Graylog and/or Postfix this may help.

My Lab set up is very simple , I’m using sendmail instead of postfix. With sendmail default uses “localhost” and port 25. The following is what I configured in Graylog server.conf file.

```auto
transport_email_enabled = true
transport_email_hostname = localhost
tansport_email_port = 25
transport_email_subject_prefix = [graylog]
transport_email_from_email = root@domain.com
transport_email_web_interface_url = https://192.168.1.100:9000

```

My Graylog Operations/Enterprise Docker I do use postfix to send email.

```auto
myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = ansible.enseva-labs.net, ansible.enseva-labs.net, localhost.enseva-labs.net, localhost
relayhost =
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = 172.17.0.1 192.168.1.101
default_transport = smtp
relay_transport = smtp
inet_protocols = all
mynetworks = 172.17.0.4 172.17.0.3 172.17.0.2
root@ansible:/etc/postfix#

```

Hope that helps

---

<div class="post-metadata">

**Author:** ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)\
**Post date:** [December 7, 2022, 11:11pm UTC](https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788/3 "2022-12-07T23:11:32Z")

</div>

Sorry I missed the port number, You you trying to use Gmail ( 587)

Try to enable TLS encrypted connection, use your real gmail account in from, and the correct smtp server address:

```auto
transport_email_hostname = smtp.gmail.com
transport_email_use_tls = true
transport_email_from_email = your_real_gmail_account@gmail.com

```

This post may help if your wanting to use Gmail

> [@How to send email alerts using Gmail](https://community.graylog.org/t/how-to-send-email-alerts-using-gmail/4103):
>
> 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…

---

<div class="post-metadata">

**Author:** ![mustafa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/mustafa/32/13708_2.png) [@mustafa](https://community.graylog.org/u/mustafa)\
**Post date:** [December 8, 2022, 2:44pm UTC](https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788/4 "2022-12-08T14:44:00Z")

</div>

Hi @gsmith ,

First of all appreciative for your response and sorry for my late response.

I tried what you said but unfortunately it is still not working 😐

I think I’m entering wrong information in “transport\_email\_hostname” and “transport\_email\_from\_email” sections.

to tell the truth i don’t know exactly what value should i put there.  
for example where can I find “[domain.com](http://domain.com)” value ? or the other values

In addition I wrote the 587 port for testing purposes. I’m thinking of using port 25

thank you in advance for your help

---

<div class="post-metadata">

**Author:** ![joe.gross](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/joe.gross/32/13372_2.png) [@joe.gross](https://community.graylog.org/u/joe.gross)\
**Post date:** [December 8, 2022, 8:36pm UTC](https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788/5 "2022-12-08T20:36:34Z")

</div>

If you can, try it first without TLS on an unencrypted SMTP server. Once you have that working, then you can tighten it up with TLS. For troubleshooting, removing variables is always a good idea. Start basic and add on in steps.

---

<div class="post-metadata">

**Author:** ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)\
**Post date:** [December 8, 2022, 10:10pm UTC](https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788/6 "2022-12-08T22:10:36Z")

</div>

Hello,

> [@mustafa](#):
>
> addition I wrote the 587 port for testing purposes. I’m thinking of using port 25

Like I post above using sendmail. Postfix should also work. Ensure the correct ports are opened on the firewall

> [@gsmith](#):
>
> ```auto
> transport_email_enabled = true
> transport_email_hostname = localhost
> tansport_email_port = 25
> transport_email_subject_prefix = [graylog]
> transport_email_from_email = root@localhost
> transport_email_web_interface_url = http://192.168.1.100:900
> 
> ```

I believe this is what @joe.gross was referring to " basic" then work from there.

> [@mustafa](#):
>
> for example where can I find “[domain.com](http://domain.com)” value ? or the other values

As shown above in my example you can use localhost for now till you can get it to work.

---

<div class="post-metadata">

**Author:** ![tmacgbay](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/tmacgbay/32/3878_2.png) [@tmacgbay](https://community.graylog.org/u/tmacgbay)\
**Post date:** [December 9, 2022, 5:13pm UTC](https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788/7 "2022-12-09T17:13:52Z")

</div>

First make sure you can access the email server from the Graylog server… outside of Graylog. Make sure you have encryption turned off on the email you are sending to for testing. You can use this link [here](https://www.sparkpost.com/blog/how-to-check-an-smtp-connection-with-a-manual-telnet-session/) to test to make sure you can connect and send e-mail from the local command line on your Graylog server. The link has a lot of detail in there but it gives you all you need to test the connection properly. Once that works, then you can work with and adjust your Graylog settings to make sure it works there as well. Once you have e-mail working and you start testing in Graylog you can watch the Graylog log files:

`tail -f /var/log/graylog-server/server.log`

Watch for related issues and post them here if you need help figuring out what they are saying.

---

<div class="post-metadata">

**Author:** ![mustafa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/mustafa/32/13708_2.png) [@mustafa](https://community.graylog.org/u/mustafa)\
**Post date:** [December 13, 2022, 1:34pm UTC](https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788/8 "2022-12-13T13:34:50Z")

</div>

Hi everyone,

thank you all for your help.  
I tried to send mail on port 25 but it did not send mail and I tried to send mail on port 587 (with gmail) and it worked.

I am sharing my /etc/graylog/server/server.conf file to help other users.

```auto
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 = your gmail adress
transport_email_auth_password = google application password
transport_email_subject_prefix = [graylog]
transport_email_from_email = your gmail adress
transport_email_web_interface_url = http://Graylog server IP adress:9000

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [December 27, 2022, 1:35pm UTC](https://community.graylog.org/t/notification-has-email-recipients-and-is-triggered-but-sending-emails-failed-sending-the-email-to-the-following-server-failed-mustafa-local-587/26788/9 "2022-12-27T13:35:49Z")

</div>

Closed on December 27, 2022, 1:35pm UTC

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