<p>I try to configure SMTP for Grafana (8.0.5). When inviting a new user Grafana tries to send the Email, but I see this message in the log of pod</p>
<p>t=2021-08-16T20:15:44+0000 lvl=eror msg=&quot;Async sent email 0 succeed, not send emails:  err: Failed to send notification to email addresses: : read tcp &lt;pod ip|k8s cluster internal IP&gt;:60938-&gt; ourmailserver:25: i/o timeout&quot; logger=notifications</p>
<p>Grafana is install in an openshift cluster. The correct mailserver IP address is used. That part is fine.</p>
<p>Our IT informed me, that only allowed IP Addresses can send email using SMTP. As the pod IP address changes with every start of the pod, the used IP to tell the SMTP server who is sending the email is constantly changing.</p>
<p>The pod is reaching the SMTP server, but the SMTP server rejects to send the email, as the sender is unknown to the SMTP server. The SMTP server does not know the pod internal IP address.</p>
<p>How can I configure Grafana or the pod, so that a known value is shown to the SMTP server as origin(sender) of the email.</p>
<p>Thanks</p>

fancyJaneDo
<p>Several solutions:</p>
<ul>
<li><p>place your Grafana on your Infra nodes, then make sure all your infra nodes may connect your SMTP</p>
</li>
<li><p>similarly, to open a single IP, set a nodeSelector placing your Grafana on a single node</p>
</li>
<li><p>look into Egress IP, see <a href="https://docs.openshift.com/container-platform/4.5/networking/openshift_sdn/assigning-egress-ips.html" rel="nofollow noreferrer">https://docs.openshift.com/container-platform/4.5/networking/openshift_sdn/assigning-egress-ips.html</a></p>
</li>
</ul>
<p>First two cases: all Pods collocated with your Grafana (or on infra nodes) would be able to send mails, which may not be what you want</p>
<p>Third case, all nodes within your Grafana project would be able to send mails - though if we want to only allow Grafana: then we can make sure there would be nothing else, in that namespace.</p>
