|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Wietse Venema (wietse
porcupine.org)Date: Fri Mar 16 2001 - 15:24:16 CST
Mendoza, Gerardo:
> I have a problem with address rewriting with the following configuration
>
> main.cf:
> recipient_canonical_maps = regexp:/etc/postfix/test
>
> /etc/postfix/test:
> /([1-9]+)
test/ 5${1}
numbers.test
> /([A-z]+)
test/ ${1}
names.test
>
> In the case that the recipient is a number, for example: 678
test, i want
> postfix to rewrite the address as
> 5678
numbers.test, my problem is that it rewrites it as:
> 5555555555678
numbers.test (that?s ten times 5 instead of just one!)
> Does anyone have a clue on why is this happening?
Postfix address mapping lookup tables are used recursively. This
ought to be a flag that you can specify along with the map, but
that has not yet been implemented. If I would finish Postfix before
release, then no-one would be able to use the software.
Right now, Postfix terminates recursion after 10 steps, or when
the result matches the input.
So, if your numerical addresses have exactly three digits, then
you can do your substitution with:
/^([0-9]{3})
test$/ 5$1
numbers.test
However, if your numbers have variable length, say, 1-3 digits,
you would be stuck with something like:
/^([0-9]{1,3})
test$/ 5$1
numbers.test
All numerical addresses would be prefixed with 5s until they all
have the same four-digit length.
Wietse
-
To unsubscribe, send mail to majordomo
postfix.org with content
(not subject): unsubscribe postfix-users
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]