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

I need to config one SMTP server (sendmail) to send mail with 2 interfaces with different ip's depending server.

For example: In same machine with to ip: 1.1.1.1 and 2.2.2.2 i need to send email a@a.com by 1.1.1.1 and b@b.com by 2.2.2.2

I don't now if i can configure it on sendmail, or use iptables, some idea ?

Thx.

share|improve this question
1  
What is this requirement for? Sending mail offsite won't matter from the SMTP's point of view. Perhaps, can you explain what you are ultimately trying to accomplish? –  Nathan Adams Apr 9 '10 at 12:30
add comment

migrated from stackoverflow.com Apr 9 '10 at 11:14

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 0 down vote accepted

Most probably you want something different (sorry to tell you that). But if you really want to send mail over different interfaces/routes you have to have these two interfaces in two different networks, which should each have a router. Look at your OS' manpage for the route command, the /etc/hosts and /etc/networks files and possibly, how to setup your NICs. Set a static route for the non-default network. This non-default network must of course reach b.com.

share|improve this answer
add comment

I found some help about this, but not say nothing to send mails with diferents ip's or interfaces, using virtusertable.

http://articles.techrepublic.com.com/5100-10878_11-5033970.html

share|improve this answer
add comment

You can find information on how to do this using exim at http://www.exim.org/exim-html-current/doc/html/spec_html/ch30.html#SECID146. The option you're looking for is "interface"

share|improve this answer
add comment

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.