Here is one way to do it, in general as the specifics will depend on far too many details you are not providing:
- you setup the new mail exchangers: you configure them for your domains, you verify manually that sending emails directly to them has the expected consequences, etc.
- you lower the TTLs on your current
MX
records for example to 5 minutes and you also lower the refresh value in the SOA. You then wait for a delay that should not exceed the maximum of (previous TTL, previous refresh) plus some margin for safety (in any way infrastructure changes like that should not be done in an hurry, you loose nothing by waiting extra time on the opposite you allow then yourself to get fewer problems). You can try on many public DNS servers if they catched the change (the new TTL should appear in the reply), like 1.1.1.1
, 8.8.8.8
, 9.9.9.9
or 80.80.80.80
- at that point, if you have the option to, you can reconfigure the current mail exchangers to just forward everything they receive to the new ones
- you change the
MX
records in the zone to point to your new email exchangers
- you monitor connections to the old one, they should vanish rapidly, but any other previous stuck email in some remote queue may be retried to them if the sender does not update its DNS resolution; in any case if you were able to configure them from previous step to send messages received there to the new hosts, there is no harm letting them run for days
- when you are satisfied nothing anymore hit the old servers you can then remember to change again the TTL in your zone and put back a more sane value for ongoing operations, like 24 hours.
If you are not able to do step 3, the above still works, it will just mean that you will have to manually handle the few emails that will keep coming to the old servers after you switched. It all depends on what they do with it, where and how the user mailboxes are stored, etc.
As for your specific questions:
Would they either go to SERVER-A or SERVER-B (that is, would e-mail providers using non-updated DNS records be able to get through to SERVER-A or would SERVER-A reject or forward it based on its updated MX-record)?
Yes, after the switch of MX
records, and whatever TTL you put (if you are tempted to put like "1 second" which is technically possible but will not work in real life because many caches do not honor, even if it is kind of a violation of the standard, TTLs that they deem to be too low and just use their own default version - this is why anything lower than 5 minutes is not a goog idea), some emails may still arrive at the old hosts. This is why it is important not to shut them down too soon. And to be prepared to do "something" with these emails coming here (hence my step 3 in the above scenario)
MTAs do not consult the DNS to know if they are relevant for the emails they receive or not, they just do based on their configuration. If your old hosts are still configured to accept email for @example.com
mailboxes, then they will still do it, even after the change. It is the exact same thing at step 1 of above scenario: you can configure your new hosts in advance of DNS changes and verify they receive emails correctly.
Would they be 'dropped' (that is neither the sender nor recipient will be aware that the message didn't go through)?
No, at least not because of the MX change. It all depends just on the old hosts email configuration.
Would the sender be notified that the message was not delivered?
Same as above. Normally this case will not happen. If old hosts bounce email then the sender will get notified yes, but this is generic email handling, and has nothing specifically to do with MX changes.