Mail server via Oracle VPS | sending to Gmail -> trouble with PTR records reddit / selfhosted ---------------------------------------------------------------------- Anejey · 2023-12-17 11:14 Hello. First of all I want to say that I'm doing this purely for the learning experience and because it's fun and cool, I'm not really planning to replace my Gmail account. I have installed Mailcow in a container on my Proxmox server. After a bit of a learning-curve I managed to get it up and running, added my domain, inbox and whatnot. My domain uses Cloudflare for it's nameservers, so it's where I set-up all my dns records. The biggest problem was that my ISP puts me behing CGNAT, so no public IP for me. I got around this a while back by using a Wireguard tunnel (in a separate container) that only routes specific ports/IPs to a Oracle VPS, so I reconfigured the tunnel to also pass through all the mailing ports. My DNS settings are like this: [sorry for the crappy censoring](https://preview.redd.it/xqbfk0ny4u6c1 .png?width=1133&format=png&auto=webp&s=bc71f1ad4c74cd44c9ef134b5ca0c51 d48bb0e9f) The 4\*.\*.\*.\* IP being my own, and the 13\*.\*.\*.\* being that of the Oracle VPS. First error I encountered was with the SPF record. I ended up just using a generator for that, since I still have no idea what it is, but it fixed the error. https://preview.redd.it/u86dx8wn5u6c1.png?width=621&format=png&auto=we bp&s=0f5fb38e22d66f5d9e5ded293e23604b0c196fce This is the error I get now. I tried looking up how to set the PTR record but it seems only ISP can do that, so I looked up how to do it via Oracle and it seems I'd need to have a paid account. I can set PTR through Cloudflare as well (not sure if that works, but it allows me to), but it doesn't seem to work so far. One idea I have is to set-up a Tailscale tunnel instead, and set the VPS as an exit node. This way I wouldn't just be forwarding certain ports, but the whole Mailcow container will think it's on the VPS. Not sure if that would help. [I can receive emails just fine.](https://preview.redd.it/mw2mmela6u6c 1.png?width=656&format=png&auto=webp&s=b2cd941bc965906fe0058156bca4282 3cb35b00e) [I can also send emails to Proton Mail without issues.](https://previe w.redd.it/c2516p1h6u6c1.png?width=912&format=png&auto=webp&s=fc440fc39 30612fe026135d46edef584d41a8085) [Another provider that receives my emails just fine. Nothing even ends up in spam \(not yet anyway\)](https://preview.redd.it/dz9m7op77u6c1.p ng?width=605&format=png&auto=webp&s=6bce38f8aff5a8748566855109b852820d a2bff1) At this point I'm rather clueless and not sure about my next step. I'd appreciate any help or guidance. ---------------------------------------------------------------------- ElevenNotes · 2023-12-17 12:02 PTR for mail.* needs to resolve to a reputable IP not another FQDN. ---------------------------------------------------------------------- Anejey · 2023-12-17 12:22 Not sure what you mean by that? I can't input the IP directly into the PTR record, it only takes a domain. ---------------------------------------------------------------------- KD_done · 2023-12-17 14:44 Yo buddy, not in your domain zone-file.. it's the reverse you should be looking at :) So I'm guessing that the server name you use to send your mail is "mail.example.com" .. so, go into your Oracle VM settings, and lookup the ip address and add a hostname. I have not much of a clue how the Oracle VM settings pages work, but.. that's where you fix it, NOT the zone-file of your domain name. PTR records are pointer records, and locally you can play around with it by creating a zone-file like 0.168.192.in-addr.arpa.. and chucking PTR records (the reverse resolution from ip to hostname) like.. [10.0.168.192.in-addr.arpa](https://10.0.168.192.in-addr.arpa) PTR mail.localhost. This only works in your own LAN, but it's essentially how it works. Good luck :) ---------------------------------------------------------------------- Anejey · 2023-12-17 15:01 Could you elaborate a bit more please? I'm looking all over the Oracle control panel and I can't seem to find anything useful. ---------------------------------------------------------------------- christiansierra · 2023-12-17 15:51 I have the same issue with oracle the ptr needs to be assigned by Oracle, not your dns, you have to open a support ticket, you give them your domain address and they will take care of assigning the PTR record to that IP. That’s the only way to do it for oracle as they don’t have a portal to configure it. I have the same issue that’s how I know. ---------------------------------------------------------------------- Anejey · 2023-12-17 16:03 Yeah, I figured that's how it's gonna be. Don't you need to be a paying customer to have access to their support ticket system? ---------------------------------------------------------------------- christiansierra · 2023-12-17 16:05 You do but you don’t. So you can upgrade your account and as long as you keep the free limits they don’t charge you a cent ---------------------------------------------------------------------- KD_done · 2023-12-17 17:36 Well.. assuming you have an VM that was offered in their IaaS environment, the explanation can be found here; [https://docs.oracle.com/en- us/iaas/Content/DNS/Tasks/reversedns.htm](https://docs.oracle.com/en- us/iaas/Content/DNS/Tasks/reversedns.htm) And, I'm assuming you only have 1 instance and no assinged /27 (let alone larger), so.. that will, according to the manual be an support ticket. .. it's an overcomplicated Oracle solution imo ---------------------------------------------------------------------- RedditSlayer2020 · 2023-12-17 18:11 Please consult oracle support because they own the subnet that holds the ip address of your VPS r/selfhosted as the name suggests is not a support system for business cloud operations. Google will help you to understand basic concepts of DNS design if you need more understanding of the technology behind it ---------------------------------------------------------------------- Anejey · 2023-12-17 18:39 I am self-hosting the mail server though. Just because I'm also integrating a 3rd party service doesn't mean this doesn't belong here. But yes, you are right. If I want to get this to work I'll have to work with Oracle now, or switch VPS provider altogether. I had hoped it might've just been a misconfiguration on my side but it's clearly not, and it has very much been a learning experience. Mail stuff is pretty new to me, but it's been fairly rewarding so far. I'm honestly surprised I managed to get it working at all. ---------------------------------------------------------------------- RedditSlayer2020 · 2023-12-17 18:41 Yes because the solution to your problem is 100% related to oracle's ability to set a PTR record for the official ip address associated with your oracle vps. ---------------------------------------------------------------------- daedric · 2023-12-17 19:02 Impossible. A normal domain is, thisdomain.com resolved to 99.99.99.99 IP. A PTR is the oposite. This IP 99.99.99.99 as a PTR of thisdomain.com. > A DNS PTR record is exactly the opposite of the 'A' record, which provides the IP address associated with a domain name. DNS PTR records are used in reverse DNS lookups. Google... does not seem to care very much that IP 99.99.99.99 as a PTR pointing to another domain other than the mail sender announced (SMPT annouce their name). But it does seem to care that there's not PTR for that IP. ---------------------------------------------------------------------- mechaelectro · 2023-12-18 02:33 Oracle Cloud had a SMTP relay service as well (at least the last time I played around with it) which you may want to consider using rather than trying to get them to update the PTR record for you. ---------------------------------------------------------------------- KD_done · 2023-12-18 12:24 I'm not sure why he was talking down to you.. yes, you need to learn more stuff, but, heck, learn by doing it and asking questions! There is nobody that will stop you in doing what you want to do to learn something new. And your question was valid here. Yes, you picked a crappy VM host (Hetzner, digitalocean, linode.. not free, but, still, it worth it to have a super cheap server) "Google will help you to understand basic concepts of DNS desgin if you need..." bla blabla.. gatekeeping BS attitude. Google can help you with everything regarding learning a new skill, but playing around with it and building it at the same time is JUST AS important. It is okay to be a bad neighbour for a bit, and set fire to some gunpowder until it goes boom, to learn what not to do next. Learn how to fix your mistakes.. a better learning experience is hard to find. You are selfhosting, you are working towards that, you are going to get there if you take it step by step. Ask questions, and ignore these types of jerks that feel the need to slow you down.