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

Re: postmap -q return code not very clear when using 'catch all' with smtp_generic_maps

Expand Messages
  • mouss
    ... postfix search order is context dependent. postmap doesn t know if you are trying a check_client_access, check_sender_access, resolving a virtual alias or
    Message 1 of 5 , Feb 20, 2010
    View Source
    • 0 Attachment
      Geert Lorang a écrit :
      > On 19/02/2010 15:49, Barney Desmond wrote:
      >> On 20 February 2010 01:40, Geert Lorang<geert@...> wrote:
      >>
      >>> glorang:~# cat /etc/postfix/generic
      >>> @... accepted@...
      >>>
      >>> Now try to lookup something@...:
      >>>
      >>> glorang:~# postmap -q something@... /etc/postfix/generic
      >>> glorang:~# echo $?
      >>> 1
      >>>
      >>> So no output (no match found) and return value> 0, so you would expect
      >>> this can't work, but in fact it just works. I would expect that "postmap
      >>> -q whatever@... /etc/postfix/generic" returns accepted@... in
      >>> every case (and return code 0), but it doesn't?
      >>>
      >>> If this is by design maybe add this somehow in the docs...
      >>>
      >> The trick is that postmap is "dumb" - it doesn't know *why* you're
      >> searching, so it doesn't strip the local part. This confuses people
      >> sometimes because using `postmap -q` isn't the same as what Postfix
      >> does, Postfix does a lot more.
      >>
      >
      > Oh. I thought postmap would do the same as Postfix. Thanks for clarifying!
      >

      postfix search order is context dependent. postmap doesn't know if you
      are trying a check_client_access, check_sender_access, resolving a
      virtual alias or looking for a domain class...
    Your message has been successfully submitted and would be delivered to recipients shortly.