Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 name.s@foobar.com, the new is name.username@foobar.com.

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.

share|improve this question
1  
Possible duplicate of: serverfault.com/questions/134478/… –  Mike B May 23 '12 at 15:21
    
I hope there is a config to change and not editing the source...that I don't have... –  Kreker May 23 '12 at 15:41

1 Answer 1

The answer to your problem is to add to the old server's sendmail.mc the following line:

define(`LUSER_RELAY', `[new.server.name]')dnl

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.

share|improve this answer
    
Ok, thanks I'll give a try. For your question, if a user doesn't exists in the current server it had to forward to the new one. I think that if the user exist in the new one all is godd, if does not the email return to the sender. –  Kreker May 24 '12 at 15:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.