[Postfixbuch-users] pcre-mappings: linke Seite immer lowercase
Martin Schwartz
martin.schwartz at java-info.de
Fr Jun 30 17:29:08 CEST 2006
Hallo zusammen,
ich bin eher zufällig auf eine Eigenheit von postfix gestoßen. Zumindest
im vom mir beobachten Fall werden bei pcre-Mappings die Eingangswerte
immer in Kleinschreibung konvertiert. Das bedeutet, dass z.B. bei
folgenden Mappings der ersetzte Wert immer kleingeschrieben ist:
/^(.*)@myotherdomain.de/ $1 at mydomain.de
Aus einem MARTIN at myotherdomain.de wird dann immer ein kleingeschriebener
martin at mydomain.de Ist das Bug oder Feature? Kennt jemand eine
entsprechende Konfigurationsoption?
Viele Grüße
Martin
Anhang (falls es jemand genau wissen will):
=== Beobachtung
Ich hatte in einem virtual_alias_maps-pcre-Mapping ungefähr das folgende
stehen:
/^(Martin)@(mydomain.de|meinedomain.de|moidomain.de)$/ $1 at mydomain.de
In pcre_table(5) steht, dass pcre per Default immer fallunabhängig
arbeitet. Ich habe daher erwartet, dass mit dem obigen Eintrag folgende
Mappings erfolgen:
1. martin at meinedomain.de -> martin at mydomain.de
2. Martin at meinedomain.de -> Martin at mydomain.de
Tatsächlich wird aber immer auf martin at mydomain.de gemappt. Mit
trivial_rewrite -v -v konnte ich nachvollziehen, dass beim Mapping der
Eingangswert immer in Kleinbuchstaben konvertiert wird.
==== Beispiel-Log 1 (/var/log/mail.log)
Die Mail ging dann an "Martin at mydomain.de" (großes M):
virtual_alias_maps:
/^(martin)@mydomain.de/ ${1}@mydomain.de
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: input attribute value: Martin at mydomain.de
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: rewrite socket: wanted attribute: (list terminator)
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: input attribute name: (end)
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: `local' `Martin at mydomain.de' -> `Martin at mydomain.de'
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: send attr flags = 0
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: send attr address = Martin at mydomain.de
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: master_notify: status 1
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: master_notify: status 0
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: rewrite socket: wanted attribute: request
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: input attribute name: request
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: input attribute value: rewrite
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: rewrite socket: wanted attribute: rule
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: input attribute name: rule
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: input attribute value: local
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: rewrite socket: wanted attribute: address
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: input attribute name: address
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: input attribute value: martin at mydomain.de
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: rewrite socket: wanted attribute: (list terminator)
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: input attribute name: (end)
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: `local' `martin at mydomain.de' -> `martin at mydomain.de'
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: send attr flags = 0
Jun 30 14:43:47 mail postfix/trivial-rewrite[3802]: send attr address = martin at mydomain.de
==== Beispiel-Log 2 (/var/log/mail.log)
Die folgende Konfiguration verursacht eine rekursive Namenersetzung (die
postfix dann irgendwann zum Glück abbricht). Man sieht, dass der
ersetzte Wert immer Großbuchstaben erhält, die dann im nächsten Match
wieder kleingeschrieben werden.
Die Mail ging dann an "Martin+SPAM at mydomain.de" (großes M):
virtual_alias_maps: corrupt entry causing recursive substitutions!
/^(martin)(\+.+)@mydomain.de/ ${1}${2}REC at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: Martin+SPAM at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: (list terminator)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: (end)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: `local' `Martin+SPAM at mydomain.de' -> `Martin+SPAM at mydomain.de'
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: send attr flags = 0
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: send attr address = Martin+SPAM at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: master_notify: status 1
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: master_notify: status 0
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: request
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: request
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: rewrite
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: rule
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: rule
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: local
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: address
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: address
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: martin+spamREC at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: (list terminator)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: (end)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: `local' `martin+spamREC at mydomain.de' -> `martin+spamREC at mydomain.de'
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: send attr flags = 0
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: send attr address = martin+spamREC at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: master_notify: status 1
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: master_notify: status 0
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: request
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: request
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: rewrite
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: rule
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: rule
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: local
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: address
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: address
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: martin+spamrecREC at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: (list terminator)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: (end)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: `local' `martin+spamrecREC at mydomain.de' -> `martin+spamrecREC at mydomain.de'
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: send attr flags = 0
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: send attr address = martin+spamrecREC at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: master_notify: status 1
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: master_notify: status 0
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: request
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: request
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: rewrite
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: rule
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: rule
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: local
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: address
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: address
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: martin+spamrecrecREC at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: (list terminator)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: (end)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: `local' `martin+spamrecrecREC at mydomain.de' -> `martin+spamrecrecREC at mydomain.de'
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: send attr flags = 0
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: send attr address = martin+spamrecrecREC at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: master_notify: status 1
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: master_notify: status 0
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: request
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: request
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: rewrite
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: rule
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: rule
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: local
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: address
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: address
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: martin+spamrecrecrecREC at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: (list terminator)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: (end)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: `local' `martin+spamrecrecrecREC at mydomain.de' -> `martin+spamrecrecrecREC at mydomain.de'
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: send attr flags = 0
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: send attr address = martin+spamrecrecrecREC at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: master_notify: status 1
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: master_notify: status 0
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: request
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: request
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: rewrite
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: rule
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: rule
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: local
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: address
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: address
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute value: martin+spamrecrecrecrecREC at mydomain.de
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: rewrite socket: wanted attribute: (list terminator)
Jun 30 14:56:00 mail postfix/trivial-rewrite[3983]: input attribute name: (end)
...
...
==== Beispiel-Log 3 (/var/log/mail.log)
Das gleiche Bild auch für /i: input immer in kleinbuchstaben.
virtual_alias_maps: corrupt entry causing recursive substitutions!
/^(martin)(\+.+)@mydomain.de/i ${1}${2}REC2 at mydomain.de
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: input attribute value: martin+spamREC2 at mydomain.de
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: rewrite socket: wanted attribute: (list terminator)
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: input attribute name: (end)
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: `local' `martin+spamREC2 at mydomain.de' -> `martin+spamREC2 at mydomain.de'
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: send attr flags = 0
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: send attr address = martin+spamREC2 at mydomain.de
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: master_notify: status 1
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: master_notify: status 0
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: rewrite socket: wanted attribute: request
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: input attribute name: request
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: input attribute value: rewrite
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: rewrite socket: wanted attribute: rule
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: input attribute name: rule
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: input attribute value: local
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: rewrite socket: wanted attribute: address
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: input attribute name: address
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: input attribute value: martin+spamrec2REC2 at mydomain.de
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: rewrite socket: wanted attribute: (list terminator)
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: input attribute name: (end)
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: `local' `martin+spamrec2REC2 at mydomain.de' -> `martin+spamrec2REC2 at mydomain.de'
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: send attr flags = 0
Jun 30 15:13:57 mail postfix/trivial-rewrite[5227]: send attr address = martin+spamrec2REC2 at mydomain.de
...
...
Mehr Informationen über die Mailingliste Postfixbuch-users