LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to make postfix accept mail from multiple domains (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-make-postfix-accept-mail-from-multiple-domains-261912/)

Farthom 12-02-2004 06:11 PM

How to make postfix accept mail from multiple domains
 
This should be an easy answer for anyone who knows the system well. I have 3 domains registered with dyndns.org and i have set up postfix on the machine they point to. ALL THREE domains point to the same machine. One of the domains is set in postfix's main.cf, and postfix WILL recieve mail to that domain. farthom@domain1.something.net However, when i send email to farthom@domain2.something.net the server rejects it, because it doesnt realize that domain2 and domain 3 are local. Is there some setting i can set, Masquarading or soemthing that rewrites *@domain2.something.net to domain1.something.net????? I hope this question makes sense.....

trickykid 12-02-2004 06:16 PM

Create your virtual domains by adding them to the virtual file in the /etc/postfix config directory.

Once you create or edit this file, run a command like this so it updates it to be readable by postfix:

cd /etc/postfix
postmap /etc/postfix/virtual <virtual

The contents of the file for virtual domains for mail will look something like this:

Code:

domain2.com VIRTUAL
user1@domain2.com            user1
user2@domain2.com            user2

Where the first line indicates the domain name and states that its a Virtual domain..

The second line is the email alias that points to the local user account, etc, kind of formatted like the aliases file.

Farthom 12-02-2004 07:45 PM

Thank you. I got it working now.

joadoor 09-14-2006 05:56 AM

all addresses
 
Hi,

This is exactly what I need to do, but I don't want to add about 150 names to this file and then maintain it.

Is there a way of getting postfix to automatically accept mail for 'user1@domain2.com' and treating it as though it was 'user1@domain1.com' (ie passing the email through to the correct mailbox on our Exchange server?)

TIA,

Andy

joadoor 09-14-2006 11:13 AM

Sorted!
 
Have managed to have a fiddle with Postfix and have found the solution.

In the virutal file you need the following line:

@domain2.com @domain1.com


That way, any email destined for anyuser@domain2.com will end up at anyuser@domain1.com

Might be simple, but I couldn't find anything specific in the man pages (or if its there, I didn't spot it)

Hope this helps someone else.

Andy


All times are GMT -5. The time now is 11:07 PM.