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

Odd trivial-rewrite complaint with postfix 2.10

Expand Messages
  • Quanah Gibson-Mount
    This started showing up sporadically in our logs after upgrading to postfix 2.10: Apr 22 14:42:50 zqa-061 postfix/trivial-rewrite[30487]: warning: do not list
    Message 1 of 4 , Apr 22, 2013
    • 0 Attachment
      This started showing up sporadically in our logs after upgrading to postfix
      2.10:

      Apr 22 14:42:50 zqa-061 postfix/trivial-rewrite[30487]: warning: do not
      list domain zqa-061.eng.vmware.com in BOTH mydestination and
      virtual_mailbox_domains


      However, it is not listed in both:

      zimbra@zqa-061:~$ postconf mydestination
      mydestination = localhost

      zimbra@zqa-061:~$ postconf virtual_mailbox_domains
      virtual_mailbox_domains = proxy:ldap:/opt/zimbra/conf/ldap-vmd.cf

      Searching using the filter defined in ldap-vmd.cf:

      zimbra@zqa-061:~$ ldapsearch -x -LLL -H ldap://zqa-061.eng.vmware.com:389
      -D uid=zmpostfix,cn=appaccts,cn=zimbra -w test123
      "(&(zimbraDomainName=*)(zimbraDomainType=local)(zimbraMailStatus=enabled))"
      zimbraDomainName
      dn: dc=zqa-061,dc=eng,dc=vmware,dc=com
      zimbraDomainName: zqa-061.eng.vmware.com

      Clearly, localhost != zqa-061.eng.vmware.com

      Any idea why then I'm getting this message?

      Thanks,
      Quanah

      --

      Quanah Gibson-Mount
      Sr. Member of Technical Staff
      Zimbra, Inc
      A Division of VMware, Inc.
      --------------------
      Zimbra :: the leader in open source messaging and collaboration
    • btb
      ... provide postconf -nf and postconf -Mf -ben
      Message 2 of 4 , Apr 23, 2013
      • 0 Attachment
        On 2013.04.22 13.35, Quanah Gibson-Mount wrote:
        > This started showing up sporadically in our logs after upgrading to
        > postfix 2.10:
        >
        > Apr 22 14:42:50 zqa-061 postfix/trivial-rewrite[30487]: warning: do
        > not list domain zqa-061.eng.vmware.com in BOTH mydestination and
        > virtual_mailbox_domains
        >
        > However, it is not listed in both:
        >
        > zimbra@zqa-061:~$ postconf mydestination mydestination = localhost
        >
        > zimbra@zqa-061:~$ postconf virtual_mailbox_domains
        > virtual_mailbox_domains = proxy:ldap:/opt/zimbra/conf/ldap-vmd.cf
        >
        > Searching using the filter defined in ldap-vmd.cf:
        >
        > zimbra@zqa-061:~$ ldapsearch -x -LLL -H
        > ldap://zqa-061.eng.vmware.com:389 -D
        > uid=zmpostfix,cn=appaccts,cn=zimbra -w test123
        > "(&(zimbraDomainName=*)(zimbraDomainType=local)(zimbraMailStatus=enabled))"
        > zimbraDomainName dn: dc=zqa-061,dc=eng,dc=vmware,dc=com
        > zimbraDomainName: zqa-061.eng.vmware.com
        >
        > Clearly, localhost != zqa-061.eng.vmware.com

        provide postconf -nf and postconf -Mf

        -ben
      • Wietse Venema
        ... This may happen with any Postfix release when $myhostname is not listed in mydestination. This Postfix limitation is easy to fix. The following requires
        Message 3 of 4 , Apr 23, 2013
        • 0 Attachment
          Quanah Gibson-Mount:
          > Apr 22 14:42:50 zqa-061 postfix/trivial-rewrite[30487]: warning: do not
          > list domain zqa-061.eng.vmware.com in BOTH mydestination and
          > virtual_mailbox_domains
          ...
          > mydestination = localhost

          This may happen with any Postfix release when $myhostname is not
          listed in mydestination. This Postfix limitation is easy to fix.

          The following requires some patience from the reader.

          Normal scenario:

          As trivial-rewrite resolves (tries to figure out where to
          deliver) an email address, it strips off domains that match
          $mydestination, and saves the last stripped-off domain.

          If this process reduces the address to just a recipient local-part,
          then the resolver concludes that the address is in the "local
          address class". At that point we have the recipient localpart
          and the saved last stripped-off domain that matched $mydestination.

          Error scenario:

          In rare cases the trivial-rewrite resolver is given a domain-less
          address (for example, the null recipient address). In that
          case the resolver concludes that the destination is in the
          "local address class" (1). And if the recipient local-part is
          empty the resolver replaces it with "mailer-daemon".

          At that point we have a recipient localpart, but we don't have
          a saved last stripped-off domain. However Postfix does not
          work with domain-less addresses, so trivial-rewrite uses
          $myhostname as a surrogate for the saved last stripped-off
          domain (2).

          Trivial-rewrite logs the above warning when the surrogate domain
          that was chosen in (2) is not in the address class that was chosen
          in (1).

          The discrepancy is eliminated by re-resolving the recipient localpart
          plus surrogate domain, so that it pops out of the resolver with the
          correct address class for the surrogate domain.

          The patch below maintains full backwards compatibility; if that
          were not a concern it would technically be more correct to call
          "rewrite_tree(&local_context, tree);" which appends @myorigin,
          instead of the two ad-hoc tok822_sub_append() calls that append
          @myhostname.

          Wietse

          *** ./src/trivial-rewrite/resolve.c- Mon Oct 1 16:57:50 2012
          --- ./src/trivial-rewrite/resolve.c Tue Apr 23 13:19:28 2013
          ***************
          *** 324,332 ****
          tok822_free(tree->head);
          tree->head = 0;
          }
          ! /* XXX must be localpart only, not user@domain form. */
          ! if (tree->head == 0)
          tree->head = tok822_scan(var_empty_addr, &tree->tail);

          /*
          * We're done. There are no domains left to strip off the address,
          --- 324,341 ----
          tok822_free(tree->head);
          tree->head = 0;
          }
          ! /* XXX Re-resolve the surrogate, in case not in user@domain form. */
          ! if (tree->head == 0) {
          tree->head = tok822_scan(var_empty_addr, &tree->tail);
          + continue;
          + }
          +
          + /* XXX Re-resolve with myhostname for backwards compatibility. */
          + if (domain == 0 && saved_domain == 0) {
          + tok822_sub_append(tree, tok822_alloc('@', (char *) 0));
          + tok822_sub_append(tree, tok822_scan(var_myhostname, (TOK822 **) 0));
          + continue;
          + }

          /*
          * We're done. There are no domains left to strip off the address,
        • Quanah Gibson-Mount
          --On Tuesday, April 23, 2013 1:45 PM -0400 Wietse Venema ... Thank you for the quick turn around Wietse! --Quanah -- Quanah Gibson-Mount Sr. Member of
          Message 4 of 4 , Apr 23, 2013
          • 0 Attachment
            --On Tuesday, April 23, 2013 1:45 PM -0400 Wietse Venema
            <wietse@...> wrote:

            > Quanah Gibson-Mount:
            >> Apr 22 14:42:50 zqa-061 postfix/trivial-rewrite[30487]: warning: do not
            >> list domain zqa-061.eng.vmware.com in BOTH mydestination and
            >> virtual_mailbox_domains
            > ...
            >> mydestination = localhost
            >
            > This may happen with any Postfix release when $myhostname is not
            > listed in mydestination. This Postfix limitation is easy to fix.
            >
            > The following requires some patience from the reader.

            Thank you for the quick turn around Wietse!

            --Quanah

            --

            Quanah Gibson-Mount
            Sr. Member of Technical Staff
            Zimbra, Inc
            A Division of VMware, Inc.
            --------------------
            Zimbra :: the leader in open source messaging and collaboration
          Your message has been successfully submitted and would be delivered to recipients shortly.