Linux - Software This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-10-2006, 02:09 AM
|
#1
|
|
LQ Newbie
Registered: May 2006
Posts: 5
Rep:
|
Postfix - Single domain with multipe relay host
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
|
|
|
|
05-10-2006, 10:13 AM
|
#2
|
|
LQ Newbie
Registered: Jul 2004
Posts: 23
Rep:
|
Quote:
|
Originally Posted by jignesh.vasani
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)
|
|
|
|
05-10-2006, 05:37 PM
|
#3
|
|
Senior Member
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,560
Rep: 
|
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:
Code:
virtual_alias_domains = fake.domain
virtual_alias_maps = hash:/etc/postfix/virtual
Next, create the file /etc/postfix/virtual containing the following:
Code:
him@fake.domain him@first.domain, him@second.domain
her@fake.domain her@first.domain, her@second.domain
Finally, build the hash table and reload postfix:
Code:
# postmap /etc/postfix/virtual
# postfix reload
The documentation on the postfix site explains how to do most things.
Last edited by Berhanie; 05-10-2006 at 05:55 PM.
|
|
|
|
05-11-2006, 12:11 AM
|
#4
|
|
LQ Newbie
Registered: May 2006
Posts: 5
Original Poster
Rep:
|
Quote:
|
Originally Posted by RomKnight
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.
regs
Jignesh
|
|
|
|
05-11-2006, 12:15 AM
|
#5
|
|
LQ Newbie
Registered: May 2006
Posts: 5
Original Poster
Rep:
|
Quote:
|
Originally Posted by Berhanie
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:
Code:
virtual_alias_domains = fake.domain
virtual_alias_maps = hash:/etc/postfix/virtual
Next, create the file /etc/postfix/virtual containing the following:
Code:
him@fake.domain him@first.domain, him@second.domain
her@fake.domain her@first.domain, her@second.domain
Finally, build the hash table and reload postfix:
Code:
# postmap /etc/postfix/virtual
# postfix reload
|
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 01:47 AM.
|
|
|
|
05-11-2006, 03:05 AM
|
#6
|
|
LQ Newbie
Registered: Jul 2004
Posts: 23
Rep:
|
jignesh.vasani:
I guess I mislead you.
Where it reads:
anotherdomain.tld smtp:[relay.host]  ort
.anotherdomain.tld smtp:[relay.host]  ort
should be
anotherdomain.tld smtp:[another_relay.host]  ort
.anotherdomain.tld smtp:[another_relay.host]  ort
Again, use postmap and reload postfix
|
|
|
|
05-11-2006, 07:01 AM
|
#7
|
|
LQ Newbie
Registered: May 2006
Posts: 5
Original Poster
Rep:
|
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 07:09 AM.
|
|
|
|
05-12-2006, 09:57 AM
|
#8
|
|
LQ Newbie
Registered: Jul 2004
Posts: 23
Rep:
|
My bad... sorry. I've interpreted something wrong :s
I don't think i can help much then... never think of that situation until now.
The way to go is reading about the features os postfix on mail routing and some "hacks" on master.cf... i guess.
|
|
|
|
08-26-2008, 09:01 AM
|
#9
|
|
Member
Registered: Dec 2005
Location: italia
Distribution: Debian etch stable
Posts: 532
Rep:
|
maybe a solution ....
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 !!!
|
|
|
|
11-30-2009, 03:21 AM
|
#10
|
|
LQ Newbie
Registered: Nov 2009
Posts: 1
Rep:
|
Does anyone found a solution for this pb please ? I have the same.
|
|
|
|
11-30-2009, 04:53 PM
|
#11
|
|
LQ Newbie
Registered: Nov 2009
Posts: 1
Rep:
|
Quote:
Originally Posted by bouba
Does anyone found a solution for this pb please ? I have the same.
|
I'm assuming you guys just want to keep an archived copy of the email so....
Install MailScanner and Spamassassin
Create a ruleset for non-spam emails
Ex.
{
To: domain.com deliver store-/var/archive/incoming/domain_com forward archive@domain.com
From: domain.com deliver store-/var/archive/outgoing/domain_com forward archive@domain.com
}
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.
Ex.
{
To: user1@domain.com deliver store-/var/archive/incoming/domain_com forward user1@archive.domain.com
From: user1@domain.com deliver store-/var/archive/outgoing/domain_com forward user1@archive.domain.com
}
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.
Problem solved.
If you need further help, please let me know.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:39 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|