I have an old RedHat 4 server with sendmail and I want to replace it with a new Ubuntu one. I need to have both on the same MX record for tests if the new one is working properly.
The users accounts on the new server are in different form from the old one. For example, the old is [email protected], the new is [email protected].
If I put the new server in the same mx record with a lowest priority, theorically when the first fails the email is sended to the other one (the new one). But if a I send an email address that isn't in the old server, sendmail respond me with error 5.1.1 'user doesn't exists'. There is a way to change this error, maybe with one 4xx so the relay comes to the other server?
I don't know if I did explain this well...hope you understand.
The answer to your problem is to add to the old server's sendmail.mc the following line:
You then need to follow Red Hat's advice on how to build sendmail.cf and restart sendmail. With the above setting any mail that is considered as local that reaches the old server will be forwarded to the new server for users that do not exist.
To actually change the response code for non existent users, you have to elaborate a bit more on what you want to happen when a user does not exist.