Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm looking for some advice on how best to get a Postfix server set up for sending mail out for a couple of domains.
First, this system is used only as an outgoing mail server. It's not a final destination for anything, and no mail is ever received by it. All replies are received on a different server.
The system is already functioning for 1 domain. Reverse records are set, and mail is being delivered normally.
What I'd like to do is set up a second entirely separate domain within Postfix if possible to send mail through. Using a 2nd NIC, I'd need to force email for this second domain to go through the 2nd NIC so I could properly set up the DNS records for the IP.
I've been going through the Postfix documentation, but thus far have been unable to find anything about having a second domain's email be sent through a specific interface.
I'm also not sure how to go about setting up the mydomain setting in the Postfix config for multiple domains. Again, the reading I've done so far has concentrated more on the server being a final destination for multiple domains, not a simple transit server to send mail out from multiple domains.
The server in question is running CentOS 5 and is fully upadated. If more info is needed, please let me know. Once I know where to look I should be able to figure things out from there.
I think you want to set up virtual domains on your Postfix server. There is a VIRTUAL_README file that comes with the distribution that more or less says how to do that, and what options you have. This will not automatically force mail for domain2 to leave via the second NIC, but it will leave (by whatever path the routing table says to use for a particular destination), so it will get delivered.
I think that Postfix is at the wrong level of the TCP/IP stack to try to force an override of the normal IP routing. You should do that by setting routes properly. Unfortunately, you can only specify one default route on a given machine, without doing some fairly bizarre things. Probably the cleanest way I can think of to make this happen (if you *really* want it to happen) is to run two virtual machines, and set up Postfix for one domain on one, and for the other domain on the other. Then you could have two different default routes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.