LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix regex for user@domain1 -> user (https://www.linuxquestions.org/questions/linux-server-73/postfix-regex-for-user%40domain1-user-702003/)

Stupidscript 02-03-2009 02:31 PM

Postfix regex for user@domain1 -> user
 
I have many, many domains but only a few users. Here are examples for what I would like to accomplish:

Running: Fedora 10, Postfix 2.5.5
Server primary domain: primary.com

I want this to happen:

user1@domain1.com => user1@primary.com
user1@domain2.com => user1@primary.com

Here's what I'm thinking (/etc/postfix/virtual):

/^(*.)@domain1\.com$/ $1
/^(*.)@domain2\.com$/ $1

..where a username match goes to the local user. If it's an invalid user, it will bounce when delivery to the local user is attempted. (I left off the target 'primary.com' domain because I figure mail will be delivered to the local user's mailbox by default without explicitly naming it.)

I am just now setting up the server, and I'd like not to have to test this on a live production server ... just in case of catastrophe. My other servers run Sendmail, but I would like to switch to Postfix.

In Sendmail I'm successfully doing what I need by using the following in virtusertable:

@domain1.com %1@primary.com
@domain2.com %1@primary.com

Am I on the right track with my Postfix regex and will Postfix recognize and apply my matching statement in the way I'm hoping it will?

TIA.


All times are GMT -5. The time now is 07:53 AM.