Loading ...
Sorry, an error occurred while loading the content.

Re: check_recipient_access, regexp and case sensitivity

Expand Messages
  • Viktor Dukhovni
    ... The postmap command no longer folds the case. However the access(5) layer of the SMTP server does. The tables are still case-sensitive if you wish when
    Message 1 of 6 , Mar 26, 2013
    • 0 Attachment
      On Tue, Mar 26, 2013 at 08:25:43PM +0100, Fabio Sangiovanni wrote:

      > > Addresses used in access checks are case folded in Postfix upstream
      > > of the access table. The original address goes into the queue file,
      > > but access checks use case folded addresses.
      >
      > Is it maybe the case to update the documentation, then? I can't find this
      > thing anywhere. Plus (from http://www.postfix.org/access.5.html):
      >
      > *CASE FOLDING*
      > The search string is folded to lowercase before database
      > lookup. As of Postfix 2.3, the search string is not case
      > folded with database types such asregexp <http://www.postfix.org/regexp_table.5.html>: or
      > pcre <http://www.postfix.org/pcre_table.5.html>: whose
      > lookup fields can match both upper and lower case.
      >
      >
      > There's no mention of special treatment for mail addresses as far as
      > I can see :(

      The postmap command no longer folds the case. However the access(5)
      layer of the SMTP server does. The tables are still case-sensitive
      if you wish when doing address rewriting with canonical(5),
      virtual(5), ...

      So perhaps the access(5) man-page (or else the code) needs to be updated,

      CASE FOLDING
      The search string is folded to lowercase before database lookup. As of
      Postfix 2.3, the search string is not case folded with database types
      such as regexp: or pcre: whose lookup fields can match both upper and
      lower case.

      > Mar 26 10:01:36 postfixhost postfix/smtpd[13886]: <
      > unknown[10.0.0.3]: rcpt to:<tEsT@...>
      > ...
      > Mar 26 10:01:36 postfixhost postfix/smtpd[13886]: check_access:
      > test@...

      The address is case-folded before the lookup.

      > Mar 26 10:01:36 postfixhost postfix/smtpd[13886]:
      > dict_regexp_lookup: /etc/postfix/check_recipient_access.regexp:
      > test@...
      > Mar 26 10:01:36 postfixhost postfix/smtpd[13886]:
      > check_table_result:
      > regexp:/etc/postfix/check_recipient_access.regexp REJECT wrong
      > format test@...

      Naturally the result is what you expect with the case-folded key.

      --
      Viktor.
    Your message has been successfully submitted and would be delivered to recipients shortly.