Rootless Podman + Grafana + SMTP Failed to send test alert.: failed to send email: EOF

Hi All,

I have run into an interesting situation. (names changed)

Grafana 12.0.0 in a rootless podman container.

There is a remote smtp server on another node.

podman run -d -it     
    --name=my_lab-grafana     
    --net=my_lab-network     
    --ip=10.10.0.10     
    -v $HOME/my_lab/grafana:/var/lib/grafana:U,Z     
    -v $HOME/my_lab/grafana/provisioning:/etc/grafana/provisioning:U,Z     
    --privileged     
    -e GF_AUTH_ANONYMOUS_ENABLED=false     
    -e GF_USERS_HOME_PAGE=d/my_home/my_home     
    -e GF_SMTP_ENABLED=true     
    -e GF_SMTP_HOST=smtp.mydomain.com:25     
    -e GF_SMTP_SKIP_VERIFY=true     
    -e GF_SMTP_FROM_ADDRESS=my_email@mydomain.com  
    grafana/grafana:12.0.0

The test email from alert manager throws an error, shown in the subject and as below.

image

But when I drop in to the grafana container shell and use curl to send email, it works

e4b5de81f9f6:/tmp$ curl smtp://smtp.mydomain.com --mail-from my_email@mydomain.com   --mail-rcpt my_email@mydomain.com   --upload-file email.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
104   124    0     0  104   129      0    338 --:--:-- --:--:-- --:--:--   339
e4b5de81f9f6:/tmp$ exit

e4b5de81f9f6:/tmp$ cat email.txt
From: My Email <my_email@mydomain.com>
Subject: an example.com example email

This mail is from Grafana container
e4b5de81f9f6:/tmp$

I need help to fix, as to why Grafana webapp is not able to send emails. Please.

Thanks!

Regards,

Hemant

Found it..

-e GF_SMTP_STARTTLS_POLICY=NoStartTLS \
1 Like