On Sep 26, 2009, at 6:01 PM, Wietse Venema wrote:
Erick Calder:
so I tried this:
/^([^._\/-]*)[._\/-](.*)@arix\.com$/ ${1}+$...@arix.com
Unfortunately, this causes Postfix to accept mail for non-existent
recipients (the virtual alias matches a bogus of username portion,
and Postfix discovers only upon delivery that the address is no
good).
by the "virtual alias" you mean the incoming address? if a message
were to arrive for noex...@arix.com it would fail to match the above
regex (since it must have a dot, underscore, slash or dash and it
doesn't), in which case regular handling occurs (message bounces). if
the message were for no-ex...@arix.com then it gets rerouted to n...@arix.com
which also doesn't exist and therefor bounces.
I'm clearly not understanding how this works.
To work around that, you'd need to specify explicit usernames in
the pattern, or run a policy daemon that queries a table with
known-good usernames after lopping off the extensions, and that
rejects the bogus ones.
which seemed to work fine, except for the underscores. thinking that
they might be meaningful to the set declaration I tried:
/^e_j...@arix.com$/ e...@arix.com
which also failed... so I'm mystified but I'm happy that now e/j...@arix.com
, e.j...@arix.com and e-j...@arix.com all land in my box... curiously
the address isn't actually rewritten (so I actually see the character
used). also e...@arix.com and e+j...@arix.com still work.
any light on the underscore would be cool.
Try using a hexdump tool, and see if you entered a non-ASCII code.
Wietse
well, the actual contents of the file are as follows:
/^e_j...@arix.com$/ e...@arix.com
# the following expression converts e.j...@arix.com, e-j...@arix.com
# e/j...@arix.com to e+j...@arix.com and leaves e...@arix.com alone, as
# well as respecting e+j...@arix.com
/^([^._\/-]*)[._\/-](.*)@(.*)$/ ${1}+$...@${3}
and the hexdump shows the output below. you can see that the _ is 0x5f
00000000 2f 5e 65 5f 6a 75 6e 6b 40 61 72 69 78 2e 63 6f |/^e_j...@arix.co
|
00000010 6d 24 2f 20 65 40 61 72 69 78 2e 63 6f 6d 0a 23 |m$/ e...@arix.com
.#|
00000020 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 65 | the
following e|
00000030 78 70 72 65 73 73 69 6f 6e 20 63 6f 6e 76 65 72 |xpression
conver|
00000040 74 73 20 65 2e 6a 75 6e 6b 40 61 72 69 78 2e 63 |ts e.j...@arix.c
|
00000050 6f 6d 2c 20 65 2d 6a 75 6e 6b 40 61 72 69 78 2e |om, e-
j...@arix.|
00000060 63 6f 6d 0a 23 20 65 2f 6a 75 6e 6b 40 61 72 69 |com.# e/
j...@ari|
00000070 78 2e 63 6f 6d 20 74 6f 20 65 2b 6a 75 6e 6b 40 |x.com to e
+junk@|
00000080 61 72 69 78 2e 63 6f 6d 20 61 6e 64 20 6c 65 61 |arix.com
and lea|
00000090 76 65 73 20 65 40 61 72 69 78 2e 63 6f 6d 20 61 |ves e...@arix.com
a|
000000a0 6c 6f 6e 65 2c 20 61 73 0a 23 20 77 65 6c 6c 20 |lone,
as.# well |
000000b0 61 73 20 72 65 73 70 65 63 74 69 6e 67 20 65 2b |as
respecting e+|
000000c0 6a 75 6e 6b 40 61 72 69 78 2e 63 6f 6d 0a 2f 5e |j...@arix.com
./^|
000000d0 28 5b 5e 2e 5f 5c 2f 2d 5d 2a 29 5b 2e 5f 5c 2f |([^._
\/-]*)[._\/|
000000e0 2d 5d 28 2e 2a 29 40 28 2e 2a 29 24 2f 20 24 7b |-]
(.*)@(.*)$/ ${|
000000f0 31 7d 2b 24 7b 32 7d 40 24 7b 33 7d 0a |1}+${2}@
${3}.|
000000fd