Thank you, but I never got my answer.1- Postfix or Dovecot has any option about changing default record that a mail server using?2- Could A record offer MX record in my goal? On Wed, Oct 14, 2020 at 10:09 PM, Wietse Venema<wie...@porcupine.org> wrote: Jaroslaw Rafa: > Dnia 14.10.2020 o godz. 13:38:12 Wietse Venema pisze: > > Here's some email basics. > > > > 1) You arrange for an MX and/or A record in your DNS zone. You edit > > the zone file yourself, or you use some provider's application to > > edit their zone file. > > > > example.com 10 IN MX mail.example.com. > > mail.example.com. IN A 10.0.0.2 > > > > 2) SMTP uses destination port 25 for MTA-to-MTA traffic, therefore > > the port information is not in the DNS. > > > > 3) Some remote MTA looks up your MX and/or A record and connects to > > your Postfix servers on port 25. > > I think there's one important thing to add. > > If you have a setup as above, then for mail addressed to "u...@example.com", > the remote MTA checks the MX record for example.com domain, finds out that > it points to mail.example.com, checks the A record for mail.example.com and > connects to the IP address found. > > However, if the sender addresses the email to "u...@mail.example.com", the A > record for mail.example.com is sufficient to have mail delivered (assuming > your Postfix is configured to honor both example.com and mail.example.com > names as "mydestination"). The MX record for example.com domain is not > involved in the process, as the domain in the e-mail address is > mail.example.com and not example.com. > > If there is another server within the example.com domain and it has it's own > independent Postfix instance, if you add A record for that server to the > zone file, you can send mail directly to it: > > othermail.example.com. IN A 10.0.0.4 > > Then messages addressed to "u...@othermail.example.com" will go to that > other server, while messages to "u...@example.com" will still go to > mail.example.com. > > You should not try to add another MX record for example.com domain pointing > to othermail.example.com, because if you do this, and email service on both > servers is not synchronized (which is not quite easy to do), the remote MTA > sending mail to "u...@example.com" will connect randomly to mail.example.com > or othermail.example.com, so the message will end up at random on one or the > other server (but never on both).
Except when the MX records have different preferences: example.com 10 IN MX mail.example.com. example.com 20 IN MX othermail.example.com. mail.example.com. IN A 10.0.0.2 othermail.example.com. IN A 10.0.0.4 Then, Postfix on othermail.example.com will forward u...@example.com to the primary MX host mail.example.com (assuming that mydestination is configured correctly, i.e. it does not contain example.com). Wietse