Mailserver and MX records in Cloudflare

53

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.

Share:
53

Related videos on Youtube

Piotr Dawidziuk
Author by

Piotr Dawidziuk

Updated on September 18, 2022

Comments

  • Piotr Dawidziuk
    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
      Håkan Lindqvist about 10 years
      You say that the MX record refers to dc-8c1937cd-mail.example.com. Does that name resolve?
    • Jorg Ancrath
      Jorg Ancrath about 10 years
      Yes, it is resolving to the IP where my mail server is located.
    • Michael Hampton
      Michael Hampton about 10 years
      What happened to the mail you tried to send yourself?
    • Håkan Lindqvist
      Håkan Lindqvist about 10 years
      Is it possible to connect to that IP on 25/tcp? (No firewall in the way or something like that?)
    • Jorg Ancrath
      Jorg Ancrath about 10 years
      Yes, 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
      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
      Michael Hampton about 10 years
      So 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
      Håkan Lindqvist about 10 years
      Fwiw, 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
      Håkan Lindqvist about 10 years
      I'd guess firewall if you are saying that telnet 198.91.92.162 25 works locally. You can use sudo system-config-firewall-tui on RHEL/Centos.
    • Jorg Ancrath
      Jorg Ancrath about 10 years
      Issue was inet_interfaces=localhost (needs to be all)
  • Jorg Ancrath
    Jorg Ancrath about 10 years
    Good catch on "gray" cloud thing, I missed that entirely.
  • FooBee
    FooBee over 7 years
    The question has an accepted answer. Please read those before posting something on an old question.