LinuxQuestions.org
Visit Jeremy's Blog.
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 02-03-2009, 02:31 PM   #1
Stupidscript
LQ Newbie
 
Registered: Feb 2009
Posts: 2

Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Perl: running a user-specified s/// regex? exscape Programming 9 03-12-2008 05:48 PM
Postfix unable to deliver mail because user@virtualdomain becomes user@hostname azrael808 Linux - Networking 0 04-29-2006 12:35 PM
C program to see user log on in system and print user with real user name also naveen245 Programming 2 12-21-2005 12:53 AM
POSTFIX - adding user czezz Linux - Networking 3 09-16-2005 04:39 AM
Postfix email user & linux user question. hct224 Linux - Newbie 0 11-29-2003 11:24 PM

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

All times are GMT -5. The time now is 06:29 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