# How to use a http proxy send alert email

**URL:** <https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246>\
**Category:** Configuration\
**Tags:** alerting\
**Created:** [May 22, 2024, 3:35am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246 "2024-05-22T03:35:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![shawnlunj](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@shawnlunj](https://community.grafana.com/u/shawnlunj)\
**Post date:** [May 22, 2024, 3:35am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/1 "2024-05-22T03:35:00Z")

</div>

I deployed Grafana on CentOS 7.9 to collect application logs and send email alerts. The current deployment environment cannot directly connect to the internet; it connects to the internet through an HTTP proxy such as 192.168.6.1:8088. How should I configure Grafana so that alert emails can be sent to my Gmail account?

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [May 22, 2024, 6:56am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/2 "2024-05-22T06:56:31Z")

</div>

Standard HTTP library in Go reads the environment variables `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`. So try to us these env variables - that’s the easiest way. If it is not working, then you can assume that used golang email module ignore these env variables and you should dig in Grafana source code.

---

<div class="post-metadata">

**Author:** ![shawnlunj](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@shawnlunj](https://community.grafana.com/u/shawnlunj)\
**Post date:** [May 23, 2024, 7:37am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/3 "2024-05-23T07:37:51Z")

</div>

Grafana 9.5.19 running on docker does not work.I tried setting environment variables with “–env https\_proxy=192.168.1.50:8888” and confirmed their effectiveness using the curl command. However, after experimentation, I found that sending alarms via email does not go through the http\_proxy. Even when the proxy is set to an invalid address, the alarms can still be sent.

 ![微信图片_20240523153902](https://us1.discourse-cdn.com/grafana/original/3X/5/0/507cc9f971a6e5f5428fac5170bd01aef762d096.png)

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [May 23, 2024, 7:49am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/4 "2024-05-23T07:49:17Z")

</div>

that env variable name can be case sensitive, try uppercase version

Another option may be proxy configuration on the docker daemon level.

---

<div class="post-metadata">

**Author:** ![shawnlunj](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@shawnlunj](https://community.grafana.com/u/shawnlunj)\
**Post date:** [May 23, 2024, 8:59am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/5 "2024-05-23T08:59:13Z")

</div>

Thank you for your reply. I have tested it again, and make sure Grafana can get the linux proxy settings. I found If you choose to send alerts through TINGTING or Slack, they will be sent via the proxy. However, if you have configured email notifications, the proxy will not be used.

 ![20240523165627](https://us1.discourse-cdn.com/grafana/original/3X/2/5/255cc608c71ba0b4c25d8e54dc10ef91b64cb156.png)  
 ![20240523165615](https://us1.discourse-cdn.com/grafana/original/3X/c/d/cddf106b52de021bc181387e3eaed83f6c392d30.png)

---

<div class="post-metadata">

**Author:** ![shawnlunj](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@shawnlunj](https://community.grafana.com/u/shawnlunj)\
**Post date:** [May 23, 2024, 9:09am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/6 "2024-05-23T09:09:21Z")

</div>

This is a very common scenario where many people need to monitor application logs in intranet and send emails to the internet via a proxy. I have been searching for nearly a week, and it seems that there is no easy way to achieve this. 🤣

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [May 23, 2024, 9:44am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/7 "2024-05-23T09:44:19Z")

</div>

I would say that makes sense. All tools/contact points, which are using HTTP(s) protocol respect `HTTP_PROXY` variable. But email is not going over HTTP protocol - that’s SMTP usually.

---

<div class="post-metadata">

**Author:** ![shawnlunj](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@shawnlunj](https://community.grafana.com/u/shawnlunj)\
**Post date:** [May 23, 2024, 9:50am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/8 "2024-05-23T09:50:21Z")

</div>

So, currently, Grafana does not support sending email alerts through a proxy？The alternative approach is to use webhooks to send the alert request to my own program, which can then utilize a proxy to send the email？

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [May 23, 2024, 10:02am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/9 "2024-05-23T10:02:10Z")

</div>

> [@shawnlunj](#):
>
> Grafana does not support sending email alerts through a proxy

Check the source code and you will find. But there is at least no Grafana config option for that. IMHO that’s not stopping you to solve it outside of Grafana:

- use local SMTP server, which will be “forwarding” emails outside in required way
- some advance networking (e.g. tunnelling, …)  
…

Of course solutions outside of Grafana are out of scope Grafana forum.

---

<div class="post-metadata">

**Author:** ![pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@pooh](https://community.grafana.com/u/pooh)\
**Post date:** [May 23, 2024, 10:24am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/10 "2024-05-23T10:24:33Z")

</div>

I would actually say that emails are nearly _always_ sent through a proxy.  
Unless you happen to be sending to an address which is handled by the mail  
server you send to, that mail server works out how to get the email delivered  
for you (ie: it acts as a proxy) and sends it on, either to the destination  
server, or sometimes to another proxy, and sooner or later the email arrives  
on the machine whose mailbox the recipient is collecting from.

This is simply the way SMTP was designed from the start.

Therefore I belive you can achieve what you want (Grafana alerts to be sent  
out via your local network mail relay) simply by setting up something like  
SSMTP (yes, two Ss are deliberate there) on your Grafana server.

Antony.

---

<div class="post-metadata">

**Author:** ![vicgegon](https://avatars.discourse-cdn.com/v4/letter/v/ecae2f/32.png) [@vicgegon](https://community.grafana.com/u/vicgegon)\
**Post date:** [December 17, 2025, 11:21am UTC](https://community.grafana.com/t/how-to-use-a-http-proxy-send-alert-email/122246/12 "2025-12-17T11:21:59Z")

</div>

Had a setup like that where everything sat behind [ISP proxies](https://infatica.io/isp-proxies/) and nothing could reach the outside. What helped was adding the proxy details in the email settings and pointing things to Gmail with the usual login info.
