Mailserver and MX records in Cloudflare
Solution 1
Issue was inet_interfaces = localhost
, causing postfix only to listen port 25 locally, setting it to inet_interfaces = all
fixed the issue.
Solution 2
In the CloudFlare DNS settings, make sure that you have a "gray" cloud for the mail
A record, in order for connections to that host to bypass CloudFlare and go to your mail server directly.
Beyond that, your DNS seems to be in a workable configuration, and you are (by your own admission) receiving mail successfully.
Related videos on Youtube
Piotr Dawidziuk
Updated on September 18, 2022Comments
-
Piotr Dawidziuk over 1 year
When making a query to database I have to provide a querstring and when I add a part with
"AND userName ILIKE '" + firstName + " " + lastName + "'"
it works well, only shows results when someone puts correct first name AND last name, but now I realized it also works when you put first name or last name two times in the search. So if you put first name: John, last name: John, it will still find a John Smith in the database and I really don't want it to happen.-
Håkan Lindqvist about 10 yearsYou say that the
MX
record refers todc-8c1937cd-mail.example.com
. Does that name resolve? -
Jorg Ancrath about 10 yearsYes, it is resolving to the IP where my mail server is located.
-
Michael Hampton about 10 yearsWhat happened to the mail you tried to send yourself?
-
Håkan Lindqvist about 10 yearsIs it possible to connect to that IP on 25/tcp? (No firewall in the way or something like that?)
-
Jorg Ancrath about 10 yearsYes, I can connect just fine, the IP is 198.91.92.162 and the domain for this case is jdlferreira.com. I've now tried to change the myhostname var to match the MX record and restarted postfix, again, telnet tests seem fine, but trying to send emails through gmail and the likes doesn't seem to work.
-
Jorg Ancrath about 10 years@Michael Hampton, the mail ca be found in the /home/user/Maildir/new dir, the logs show no errors whatsoever, I was under the impression emails could be found in /var/mail/user or /var/spool/mail/user, but there are no records there.
-
Michael Hampton about 10 yearsSo the mail was delivered successfully. It just isn't where you thought it would be. That's a totally separate question to "is my DNS right?"
-
Håkan Lindqvist about 10 yearsFwiw, I get 'connection refused' if I connect to 198.91.92.162 port 25. However, if you had it working I suppose you are just making some changes at the moment(?)
-
Håkan Lindqvist about 10 yearsI'd guess firewall if you are saying that
telnet 198.91.92.162 25
works locally. You can usesudo system-config-firewall-tui
on RHEL/Centos. -
Jorg Ancrath about 10 yearsIssue was inet_interfaces=localhost (needs to be all)
-
-
Jorg Ancrath about 10 yearsGood catch on "gray" cloud thing, I missed that entirely.
-
FooBee over 7 yearsThe question has an accepted answer. Please read those before posting something on an old question.