(OT) Postfix Virtual

Glenn Steen glenn.steen at GMAIL.COM
Wed Nov 30 22:16:04 GMT 2005


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

On 30/11/05, Peter Russell <pete at enitech.com.au> wrote:
> Ahh thanks.
>
> I could use your second example, the username format is different
> between these systems. What is the . for in @.* ?

The dot match any character, and the * means "zero or more"... A +
means "one or more".
I think you need test this fairly carefully, if you decide to go this
way, since PF will not do the "magic exploding" it usually does when
matching regular expressions.

>
> /user1 at .*/ user2 at domain3.tld
>
> or i guess if i knew the regexp i could use something like your
> /(.*)@domain[12].tld/ $1 at domain3.tld

Well, that is rather more like a "not as efficient" version of the
first suggestion (he said with a blush:), so might not lead anywhere.
If the user part of the address is the same, I'd test out the first
suggestion, that doesn't involve regular expressions, instead.

> How would this work for for and does it mean i could get away with
> having that one line?
> domain1 (@sub.mydomain.com)
> domain2 (@mydomain.com)
> domain3 (@domain3.com)

Hmmm, not as that.... Assuming I'm not completely off-base, it'd need
be something more like:
@domain1 @sub.mydomain.com
@domain2 @mydomain.com
@domain3 @domain3.com
... which would translate a hypothetical address like this:
pete at domain1 to pete at sub.mydomain.com
pete at domain2 to pete at mydomain.com
pete at domain3 to pete at domain3.com
(note that the last isn't actually the same domain part:-).

Now, if you have "pete" in domain1.com _and_ in sub.domain2.com and
want that translated to peter at domain3.com, you'd need use an RE for
that. Something like

/^pete at .*}.domain[12].*/ peter at domain3.com
(this one tries to be more specific, so that only domain1 and domain2
(with subdomains) would be affected. The "^" at the start is to only
match "pete", no other user part ending in "pete")
And perhaps you have the user "compete" there too, but this one should
be translatet to "challange"? Add another line like:
/^compete at .*}.domain[12].*/ challange at domain3.com

So ... it's a bit ugly, but would mean one line per user... Might be
easier to just mangle a list of the users once (the domains are
"semi-dead", right? Or are there new users added to them?).

And remember, I've not been able to test this even a tiny little bit
... yet:-). So take care and test everything you do...

> Many thanks for your help
> Pete
>
>
> Glenn Steen wrote:
> > On 30/11/05, Glenn Steen <glenn.steen at gmail.com> wrote:
> > (snip)
> >
> >>@domain1.tld @domain3.tld
> >>@domain2.tld @domain3.tld
> >
> > (snip)
> >
> >>/(.*)@domain[12].tld/ $1 at domain3.tld
> >
> > (snip)
> > those two would be rather equivalent... probably not what you're looking for.
> > You might be more interrested in something like:
> > /user1 at .*/ user2 at domain3.tld
> > although that would assume that user1 could never exist in any but the
> > affected domains. I'm sure you can imagine the permutations...
> >
> > --
> > -- Glenn
> > email: glenn < dot > steen < at > gmail < dot > com
> > work: glenn < dot > steen < at > ap1 < dot > se
> >
> > ------------------------ MailScanner list ------------------------
> > To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
> > 'leave mailscanner' in the body of the email.
> > Before posting, read the Wiki (http://wiki.mailscanner.info/) and
> > the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
> >
> > Support MailScanner development - buy the book off the website!
> >
> >
> >
>
> ------------------------ MailScanner list ------------------------
> To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
> 'leave mailscanner' in the body of the email.
> Before posting, read the Wiki (http://wiki.mailscanner.info/) and
> the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
>
> Support MailScanner development - buy the book off the website!
>


--
-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!



More information about the MailScanner mailing list