>I also totally agree with you that Y should not be "storing" emails , but rather "Store&Forward" as you mentioned.
I presume that's what you intended to say?
---
Just to add a bit more to my previous comment while I'm here:-
If the domain were fred.com then you might setup
10 mail.fredx.com
20 mail.fredy.com
where 10, 20 are MX priorities and mail.fredx.com points to X; and mail.fredy.com points to Y. You register the domain fredy.com and set that up to point only to Y.
(1) Now when a mail hits the fred.com domain, it either gets routed to X (normal state of affairs), or it goes to the store and forward server on Y. Y is setup to forward emails received on fred.com back to X when X is proved to be up.
(2) When a mail is dealt with correctly by X, there is a global Rule in there which copies all mail to Y. So if someone has written an email to
[email protected] it will get copied to Y, but to do that the domain name has to be changed to fredy.com (otherwise it will fold back on itself, you could in fact use email addresses that use domain literals to point directly to Y e.g., jim@[a.b.c.d] where a.b.c.d is the IP address where mail.fredy.com resides). So the rule will copy mail to
[email protected] to
[email protected]. Y receives the email and perceives it to be distinct from its' "Store & Forward" role and will therefore shunt it into the appropriate mailbox (jim).
I was thinking the way to deal with mail that came to Y with "recipient=fred.com" would be to setup a rule which said "if mail is marked as recipient=fred.com then send a copy to the same recipient at fredy.com". This would then deal with all eventualities.
The weak link in the chain now would be the Host of your DNS records.