PMM outlook email alerts not working

Description:

We have recently installed PMM 3 and trying to configure the email alerts(Outlook). I have followed the as mentioned in the doc but getting connection refused error even the SMTP port is open (25) on local host.

Can some one please guide me what’s the issue and resolve it?

docker run --detach
–restart always
–publish 443:8443
–volume /data/srv:/srv
–network=pmm-network
–name pmm-server
-e GF_SMTP_ENABLED=true
-e GF_SMTP_HOST=localhost:25
-e GF_SMTP_USER=user
-e GF_SMTP_FROM_ADDRESS=user@company.com
-e GF_SMTP_FROM_NAME=Grafana
percona/pmm-server:3

I believe docker resolves localhost:25 to 127.0.0.1:25, which does not point to the host machine’s local IP, but to the container’s.

Have you tried setting the GF_SMTP_HOST variable to host.docker.internal:25?

You can read more here - Explore networking features on Docker Desktop | Docker Docs.

Thank you, @ademidoff. I haven’t tried it. Let me test it and let you know.

Tested it and now its getting timeout.

Can you test your SMTP with telnet?

What’s the output of telnet localhost 25, if you run it on the host?

You may also want to check this thread - Trouble with smtp contact point in pmm 2.42.0 - #4 by steve.hoffman.

Let’s see if it helps resolve your issue.

Yes, the telnet is working

I am seeing below messages in the grafana log, also I ahve observed that error=“invalid Service Token/API key”

Is it an issue?

logger=context userId=0 orgId=0 uname= t=2025-04-04T05:36:19.091385556Z level=info msg=“Request Completed” method=GET path=/api/auth/key status=401 remote_addr=127.0.0.1 time_ms=27 duration=27.948466ms size=40 referer= handler=/api/auth/key/ status_source=server
logger=context userId=1 orgId=1 uname=admin t=2025-04-04T05:36:20.994738851Z level=info msg=“Request Completed” method=GET path=/api/plugins/grafana-oncall-app/settings status=404 remote_addr=127.0.0.1 time_ms=4 duration=4.012874ms size=64 referer=“https:///graph/alerting/routes?contactPoint=grafana-default-email” handler=/api/plugins/:pluginId/settings status_source=server
logger=context userId=1 orgId=1 uname=admin t=2025-04-04T05:36:21.535075763Z level=info msg=“Request Completed” method=GET path=/api/plugins/grafana-oncall-app/settings status=404 remote_addr=127.0.0.1 time_ms=4 duration=4.425887ms size=64 referer=“https:///graph/alerting/routes?contactPoint=grafana-default-email” handler=/api/plugins/:pluginId/settings status_source=server
logger=authn.service t=2025-04-04T05:36:25.436933267Z level=warn msg=“Failed to authenticate request” client=auth.client.api-key error=“invalid Service Token/API key”
logger=context userId=0 orgId=0 uname= t=2025-04-04T05:36:25.43700847Z level=error msg=“Auth method is not service account token” error=“failed to get service account info” remote_addr=127.0.0.1 traceID=
logger=context userId=0 orgId=0 uname= t=2025-04-04T05:36:25.437235196Z level=info msg=“Request Completed” method=GET path=/api/auth/serviceaccount status=400 remote_addr=127.0.0.1 time_ms=28 duration=28.430402ms size=67 referer= handler=/api/auth/serviceaccount/ status_source=server
logger=authn.service t=2025-04-04T05:36:25.438304414Z level=warn msg=“Failed to authenticate request” client=auth.client.api-key error=“invalid Service Token/API key”
logger=context userId=0 orgId=0 uname= t=2025-04-04T05:36:25.439146924Z level=error msg=“Auth method is not service account token” error=“failed to get service account info” remote_addr=127.0.0.1 traceID=
logger=authn.service t=2025-04-04T05:36:25.439167312Z level=info msg=“Failed to authenticate request” client=auth.client.basic error=“[password-auth.failed] failed to authenticate identity: [identity.not-found] no user found: user not found”
logger=context userId=0 orgId=0 uname= t=2025-04-04T05:36:25.439212112Z level=info msg= error=“[password-auth.failed] failed to authenticate identity: [identity.not-found] no user found: user not found” remote_addr=127.0.0.1 traceID=
logger=context userId=0 orgId=0 uname= t=2025-04-04T05:36:25.439430925Z level=info msg=“Request Completed” method=GET path=/api/auth/serviceaccount status=400 remote_addr=127.0.0.1 time_ms=24 duration=24.552257ms size=67 referer= handler=/api/auth/serviceaccount/ status_source=server
logger=context userId=0 orgId=0 uname= t=2025-04-04T05:36:25.43947679Z level=info msg=“Request Completed” method=GET path=/api/auth/key status=401 remote_addr=127.0.0.1 time_ms=1 duration=1.73012ms size=121 referer= handler=/api/auth/key/ status_source=server
logger=authn.service t=2025-04-04T05:36:25.441055683Z level=info msg=“Failed to authenticate request” client=auth.client.basic error=“[password-auth.failed] failed to authenticate identity: [identity.not-found] no user found: user not found”

is your SMTP configured to work from non-localhost IPs? can you connect to SMTP from container?

@nurlan, Don’t know.

@ademidoff I have tested telnet as described in the shared doc and I am unable to send email, It showed that email is queued but never get it my mailbox.

telnet smtp.server 25
helo test
mail from: user@domain.com
rcpt to: recipient@domain.com
data
subject: test
this is a test message

That’s a problem with your mail server then, not PMM. Take some time to resolve all issues with the mail server; ensure it works by itself, then test with PMM.

Its working by changing the network to host, earlier it was pmm-network. My concern here is can I use the host network?

Thanks,
–Prabha

You can use the host network, as long as you don’t expose PMM Server to the internet. However, this is not the best practice from security standpoint.

SMTP should work even without setting --network=host.