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.
> 
>     exammple.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).

Hope this clarifies your doubts a bit...
-- 
Regards,
   Jaroslaw Rafa
   r...@rafa.eu.org
--
"In a million years, when kids go to school, they're gonna know: once there
was a Hushpuppy, and she lived with her daddy in the Bathtub."

Reply via email to