Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am trying to setup a solution using Postfix as MTA.
My requirement is as follows:
- A mail for a particular domain should be relayed to one server.
- In addition to this another copy for the same user, same domain should be relayed to another server.
Basically, one incoming smtp stream split into 2 distinct outgoing relay streams.
See if any one knows how to achieve this through Postfix.
I am trying to setup a solution using Postfix as MTA.
My requirement is as follows:
- A mail for a particular domain should be relayed to one server.
- In addition to this another copy for the same user, same domain should be relayed to another server.
Basically, one incoming smtp stream split into 2 distinct outgoing relay streams.
See if any one knows how to achieve this through Postfix.
regards
Jignesh Vasani
vi /etc/postfix/transport
domain.tld smtp:[relay.host]ort
.domain.tld smtp:[relay.host]ort
anotherdomain.tld smtp:[relay.host]ort
.anotherdomain.tld smtp:[relay.host]ort
DONT FORGET TO: postmap hash:/etc/postfix/transport
in /etc/postfix/main.cf
transport_maps = hash:/etc/postfix/transport
Now if I could only relay by sender AND authenticate the postfix client to the relayhost of my choice with sender_transport_maps and sasl... (hint, hint)
Suppose that the domain in question is fake.domain, and that mail of the form user@fake.domain should be sent to both user@first.domain and user@second.domain. It's probably a bad idea to accept mail to just anyone at fake.domain because of all the spam we would receive. So, let's say that him@fake.domain and her@fake.domain are the only valid addresses for fake.domain.
First, /etc/postfix/main.cf should contain the following:
vi /etc/postfix/transport
domain.tld smtp:[relay.host]ort
.domain.tld smtp:[relay.host]ort
anotherdomain.tld smtp:[relay.host]ort
.anotherdomain.tld smtp:[relay.host]ort
DONT FORGET TO: postmap hash:/etc/postfix/transport
in /etc/postfix/main.cf
transport_maps = hash:/etc/postfix/transport
Now if I could only relay by sender AND authenticate the postfix client to the relayhost of my choice with sender_transport_maps and sasl... (hint, hint)
Thank you RomKnight,
By the transport method that you suggested, mail for domain.tld gets relayed to only the first relay.host
What I want is that it should relay to both the relay host?
Let me know if you know how to make that work.
Suppose that the domain in question is fake.domain, and that mail of the form user@fake.domain should be sent to both user@first.domain and user@second.domain. It's probably a bad idea to accept mail to just anyone at fake.domain because of all the spam we would receive. So, let's say that him@fake.domain and her@fake.domain are the only valid addresses for fake.domain.
First, /etc/postfix/main.cf should contain the following:
Thank you berhanie!
By the method you suggested, domain name will be changed to first and second. I want to retain the domain. Further, I do not want to specify all the users for that domain. The user rule set will be set on the 2 relay hosts that I am trying to relay the domain.
regards
Jignesh
Last edited by jignesh.vasani; 05-11-2006 at 02:47 AM.
RomKnight,
Let me explain my requirement clearly.
-> A mail coming in for lets say an email ID jigs@jigs.com
-> It is recieved by the server and relayed to an IP Address e.g. 10.1.1.1
-> Another copy of the mail is relayed to another IP Address e.g. 10.1.1.2
-> In both the relaying domain name remains the same. The mail is simply relayed to 2 IP addresses simultaneously.
According to the solution you provided, mail for one domain (jigs@jigs.com) will be relayed to an IP Address and mail for another domain (jigs@xyz.com) will be relayed to another.
I want a solution for one domain relayed to 2 IP addresses at the same time.
Last edited by jignesh.vasani; 05-11-2006 at 08:09 AM.
Have a look to this postfix.org page , http://www.postfix.org/SOHO_README.html , "Supporting multiple ISP accounts in the Postfix SMTP client" , i dont' know if it is your case but it sounds like !!!
This will take any mail from domain.com deliver it to the intended user, store the email in a file in /var/archive/<direction>/domain_com and then send it to another email account.
If you want it to go to a seperate mail server you can edit the transport map for that subdomain that the mail is forwarded to point to another sub-domain and change "forward archive@domain.com" to "forward archive@archive.domain.com". Otherwise get exim4 and do split spools.
You can also do per user for the ruleset so you could do something like this.
If you are really that concerned about it being the same "domain" the servers can "think" they are both part of the same domain but the server sending them the mail doesn't have to. Just edit the hosts file of the server that is splitting the mail so it thinks it is on a subdomain.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.