LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-29-2013, 11:18 PM   #1
adam7979
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Rep: Reputation: 0
Postfix for single domain with multiple host


Hi,

We've a hosting account for example.com with web hosting company, with 3 locations sharing the same domain name.

At location 1, we have L1user1@example.com, L1user2@example.com etc. If I send mail to L2user1@example.com it returns

550 5.1.1 <L2user1@example.com>: Recipient address rejected: User unknown in virtual alias table


I've tried

/etc/postfix/main.cf:

virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains = example.com
transport_maps = hash:/etc/postfix/transport
relay_host = smtp.somewebhostingcompany.com

/etc/postfix/transport:

example.com relay:[smtp.somewebhostingcompany.com]

/etc/postfix/virtual:

L1user1@example.com L1user1.localvirtual
L1user2@example.com L1user2.localvirtual


What i'd like to achieve is whenever L1user1 sending emails to (anyone)@example.com it will be relayed to smtp.somewebhostingcompany.com whenever the user is not found in local virtual table.

Thanks.

Regards,
Adam
 
Old 08-30-2013, 12:33 AM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
It doesn't work like that.
Either a domain is local (meaning local delivery is attempted) or it is not (meaning mail is relayed to the server responsible for that domain).

You probably want to use subdomains (user@sub1.domain.com, user@sub2.domain.com) so mail can be routed to the correct server, with a single server handling the head domain.
You can also use aliases and address rewriting to achieve your user@domain.com addresses to be used both internally and externally, but you want to plan it out carefully as these setups can get messy and confusing very quickly.
 
Old 08-30-2013, 03:52 AM   #3
adam7979
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
hmmmm ok then, thanks for the quick reply. Guess i'll have to figure some other way out.
 
Old 08-30-2013, 04:27 AM   #4
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Probably set up one of the servers to be the MX host for domain.com, with a virtual alias table mapping all the user@domain.com to their respective user@sub.domain.com addresses (it can also be a sub.domain.com host).

Each of the sub's should also have an alias table for the local users (local1@domain.com -> local1@sub.domain.com) so "in house" mail doesn't need to go out to the domain.com server and back.

Keeping the local and master lists in sync is an extra maintenance task though.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Single Host Postfix Configuration monojeffrey Linux Mint 1 06-08-2013 11:49 PM
creating multiple user in multiple linux boxes from single remote host niaz_ph Linux - Newbie 3 09-12-2011 03:48 PM
Postfix - domain to single IP mapping jcoxen Linux - Server 7 11-22-2010 12:18 PM
Multiple postfix smtp server for a single domain satish.apg Linux - Server 2 03-16-2010 07:36 AM
Postfix - Single domain with multipe relay host jignesh.vasani Linux - Software 10 11-30-2009 04:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration