# Matt Mail

One of my original motivations to learn how to use Docker was to get an email server going. Trying to piece one together on a VM is a pain in the butt, and my past attempts had not enjoyed much success. The project I located for email is [poste.io](https://poste.io/doc/ "Post-ee-oh's"), and configuring this system in Docker is nearly insultingly easy. I have an email server at [https://mail.breadvault.net/webmail/](https://mail.breadvault.net/webmail/), though this one does not sync with Active Directory. Not a big deal, I don't think many folks are interested in my email server here, though it would be easy enough for me to make forwarders and stuff for other domains for free if anyone needs it. If you want a mailbox on my server, I will happily make one, just email me. Here are all the domains I can make mailboxes for. One valid use case for this is 2FA with my SSO if your email provider is clicking the revoke link when doing spam scanning. These are the domains I have set up for email.

[![image.png](https://kb.matt-cloud.com/uploads/images/gallery/2026-10/scaled-1680-/Tj1image.png)](https://kb.matt-cloud.com/uploads/images/gallery/2026-10/Tj1image.png)  
  
I recently discovered that my emails weren't being received by gmail. I eventually discovered this was because gmail requires sending email servers to have a [reverse DNS ](https://en.wikipedia.org/wiki/Reverse_DNS_lookup " reverse DNS")address entry. I called up Comcast and got them to add a rDNS entry for the IP that **mail.breadvault.net** pointed to, but gmail still wasn't budging. I eventually noticed that gmail was talking about the actual sending IP of the server had to match the rDNS entry for the IP the emails were actually coming from and not just that the A record matched the rDNS record. I updated the outbound routing of the firewall here to send outgoing traffic from the mail internal IP to the outbound IP that matches **mail.breadbault.net** and then updated behemoth to route traffic on the mail docker network to the mail IP.

<details id="bkmrk-bounceback-message-r"><summary>Bounceback message</summary>

<div class="message-htmlpart" id="bkmrk-reaction-of-the-serv"><div class="rcmBody"><table cellpadding="0" cellspacing="0" class="v1email-wrapper"><tbody><tr><td align="left">Reaction of the server:  
Error: 550 5.7.25 \[50.247.115.253\] The IP address sending this message does not have a 5.7.25 PTR record setup, or the corresponding forward DNS entry does not 5.7.25 point to the sending IP. As a policy, Gmail does not accept messages 5.7.25 from IPs with missing PTR records. For more information, go to 5.7.25 https://support.google.com/mail/answer/81126#ip-practices 5.7.25 To learn more about Gmail's sender policy, go to 5.7.25 https://support.google.com/mail/answer/81126. j23-20020a635517000000b005f0bc6f9563si6506071pgb.339 - gsmtp

</td></tr></tbody></table>

</div></div><div class="message-part" id="bkmrk-original-envelope-id"><div class="pre">Original-Envelope-Id: &lt;<1d3995760b27bf30bc703469e587a616@breadvault.net>&gt;  
Reporting-MTA: dns;mail.breadvault.net  
Arrival-Date: Sun, 21 Apr 2024 07:53:32 -0700  
  
Final-Recipient: rfc822;<neo13theone@gmail.com>  
Action: failed  
Remote-MTA: gmail-smtp-in.l.google.com  
Diagnostic-Code: smtp;550 5.7.25 [50.247.115.253] The IP address sending this message does not have a 5.7.25 PTR record setup, or the corresponding forward DNS entry does not 5.7.25 point to the sending IP. As a policy, Gmail does not accept messages 5.7.25 from IPs with missing PTR records. For more information, go to 5.7.25 [https://support.google.com/mail/answer/81126#ip-practices](https://support.google.com/mail/answer/81126#ip-practices) 5.7.25 To learn more about Gmail's sender policy, go to 5.7.25 [https://support.google.com/mail/answer/81126](https://support.google.com/mail/answer/81126). j23-20020a635517000000b005f0bc6f9563si6506071pgb.339 - gsmtp</div></div></details>The first step was to contact comcast and get the rDNS entry going. Once that was good I waited a really long time for propagation, but then I finally noticed the IP in the bounceback wasn't the IP of breadvault. That's when I set up the reverse NAT settings for the mail IP and the iptables config in Behemoth.

[![image.png](https://kb.matt-cloud.com/uploads/images/gallery/2024-04/scaled-1680-/Wdyimage.png)](https://kb.matt-cloud.com/uploads/images/gallery/2024-04/Wdyimage.png)

[![image.png](https://kb.matt-cloud.com/uploads/images/gallery/2024-04/scaled-1680-/tNVimage.png)](https://kb.matt-cloud.com/uploads/images/gallery/2024-04/tNVimage.png)