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

Losing address extension in destination of virtual map

Expand Messages
  • Matt Holgate
    Hi, I ve got a virtual map with lines as follows: abc@example.com mydomain+abc@gmail.com def@example.com mydomain+def@gmail.com However, it seems like
    Message 1 of 8 , Apr 27, 2014
    • 0 Attachment
      Hi,

      I've got a virtual map with lines as follows:

      abc@... mydomain+abc@...
      def@... mydomain+def@...

      However, it seems like when the lookup occurs, the address extension
      (+abc or +def) of the destination address is removed.

      Is there any way of avoiding this? I see there is a
      'propagate_unmatched_extensions' parameter, but I'd have thought this
      would have no effect as there is no extension in the original address.

      Also, propagate_unmatched_extensions sounds like a really useful option
      in its own right, so I'd rather not disable it, unless there's no
      alternative.

      Many thanks for your help
      Matt.
    • Wietse Venema
      ... No that is backwards. It propagates the extension that exists in the original address and that is not matched by the lookup table. original:
      Message 2 of 8 , Apr 27, 2014
      • 0 Attachment
        Matt Holgate:
        > Is there any way of avoiding this? I see there is a
        > 'propagate_unmatched_extensions' parameter, but I'd have thought this
        > would have no effect as there is no extension in the original address.

        No that is backwards. It propagates the extension that exists in the
        original address and that is not matched by the lookup table.

        original: name+ext@...

        table: name@... -> foobar@...

        result: foobar+ext@...

        Wietse
      • Matt Holgate
        ... Indeed - sorry, I didn t explain myself very well! What I m trying to achieve is to forward unextended addresses in my parent s domain to extended
        Message 3 of 8 , Apr 27, 2014
        • 0 Attachment
          On 27/04/2014 13:21, Wietse Venema wrote:

          > Matt Holgate:
          >> Is there any way of avoiding this? I see there is a
          >> 'propagate_unmatched_extensions' parameter, but I'd have thought this
          >> would have no effect as there is no extension in the original address.
          >
          > No that is backwards. It propagates the extension that exists in the
          > original address and that is not matched by the lookup table.
          >
          > original: name+ext@...
          >
          > table: name@... -> foobar@...
          >
          > result: foobar+ext@...

          Indeed - sorry, I didn't explain myself very well!

          What I'm trying to achieve is to forward unextended addresses in my
          parent's domain to extended addresses at Gmail.

          My parents share a common gmail account, and use Gmail filters to sort
          'private' messages sent to their address extensions into separate folders.

          I've set this up on my Postfix server as follows:

          dougandmarilyn@... holgates@...
          doug@... holgates+doug@...
          marilyn@... holgates+marilyn@...


          The problem I am seeing is that when I send a message to e.g.
          doug@..., it is getting mapped to holgates@..., i.e.
          the destination address extension +doug is getting stripped out by Postfix.

          I just wondered if there was any way to prevent this happening?

          Many thanks
          Matt.
        • Matt Holgate
          ... D oh, sorry! I just realised I had a catchall address setup as well, which was causing the problem (i.e. it was nothing to do with address extensions):
          Message 4 of 8 , Apr 27, 2014
          • 0 Attachment
            On 27/04/2014 13:35, Matt Holgate wrote:

            > What I'm trying to achieve is to forward unextended addresses in my
            > parent's domain to extended addresses at Gmail.

            D'oh, sorry! I just realised I had a catchall address setup as well,
            which was causing the problem (i.e. it was nothing to do with address
            extensions):

            dougandmarilyn@... holgates@...
            doug@... holgates+doug@...
            marilyn@... holgates+marilyn@...
            @... holgates@...

            It seemed like the catchall address was getting triggered for e.g.
            doug@.... I'm guessing I need to put the catchall rule at
            the top?

            thanks
            Matt.
          • Wietse Venema
            ... As documented in the virtual(5) manpage, virtual alias lookups are recursive (the result of lookup is subject to alias lookup). Recursion for address X
            Message 5 of 8 , Apr 27, 2014
            • 0 Attachment
              Matt Holgate:
              > It seemed like the catchall address was getting triggered for e.g.
              > doug@.... I'm guessing I need to put the catchall rule at
              > the top?

              As documented in the virtual(5) manpage, virtual alias lookups are
              recursive (the result of lookup is subject to alias lookup).
              Recursion for address X terminates when a lookup for address X
              produces no result or when the result contains address X.

              To prevent an address from matching the wild-card, specify a
              one-on-one mapping:

              foo@... foo@...
              @... something-else@...

              Wietse
            • Wietse Venema
              ... This looks like the fantasy domain example in http://www.postfix.org/SOHO_README.html#fantasy You d do something like: /etc/postfix/main.cf:
              Message 6 of 8 , Apr 27, 2014
              • 0 Attachment
                Matt Holgate:
                > Indeed - sorry, I didn't explain myself very well!
                >
                > What I'm trying to achieve is to forward unextended addresses in my
                > parent's domain to extended addresses at Gmail.
                >
                > My parents share a common gmail account, and use Gmail filters to sort
                > 'private' messages sent to their address extensions into separate folders.
                >
                > I've set this up on my Postfix server as follows:
                >
                > dougandmarilyn@... holgates@...
                > doug@... holgates+doug@...
                > marilyn@... holgates+marilyn@...

                This looks like the "fantasy domain" example in
                http://www.postfix.org/SOHO_README.html#fantasy

                You'd do something like:

                /etc/postfix/main.cf:
                smtp_generic_maps = hash:/etc/postfix/generic

                /etc/postfix/generic:
                dougandmarilyn@... holgates@...
                doug@... holgates+doug@...
                marilyn@... holgates+marilyn@...
                @... holgates+other@...

                This correctly fixes the address in From/To/Cc/etc headers, too.

                Wietse
              • Matt Holgate
                ... Thanks Wietse! Actually, theirdomain.com was a placeholder (I wanted to avoid exposing their real domain to mailing list and thus making it a target of
                Message 7 of 8 , Apr 27, 2014
                • 0 Attachment
                  On 27/04/2014 14:18, Wietse Venema wrote:

                  > This looks like the "fantasy domain" example in
                  > http://www.postfix.org/SOHO_README.html#fantasy
                  >
                  > You'd do something like:
                  >
                  > /etc/postfix/main.cf:
                  > smtp_generic_maps = hash:/etc/postfix/generic
                  >
                  > /etc/postfix/generic:
                  > dougandmarilyn@... holgates@...
                  > doug@... holgates+doug@...
                  > marilyn@... holgates+marilyn@...
                  > @... holgates+other@...
                  >
                  > This correctly fixes the address in From/To/Cc/etc headers, too.

                  Thanks Wietse! Actually, 'theirdomain.com' was a placeholder (I wanted
                  to avoid exposing their real domain to mailing list and thus making it a
                  target of spam). The domain they are using is real :)

                  It turned out in the end that the problem was entirely down to the setup
                  of the gmail filters. Postfix was doing exactly what I intended, but I
                  had misread the headers when looking at the mail that arrived at gmail,
                  and I'd misread my own log files too. I'm really not having a good day :(.

                  Sorry for wasting your time, and thanks for all your help (and for all
                  your great work on Postfix over the years!).

                  Matt.
                • Richard Damon
                  ... As a point of information, there is a set of domains set aside specifically for this sort of use case, example.com, example.org, example.net (in fact, just
                  Message 8 of 8 , Apr 27, 2014
                  • 0 Attachment
                    On 4/27/14, 9:36 AM, Matt Holgate wrote:
                    >
                    > Thanks Wietse! Actually, 'theirdomain.com' was a placeholder (I wanted
                    > to avoid exposing their real domain to mailing list and thus making it
                    > a target of spam). The domain they are using is real :)
                    >
                    > Matt.
                    As a point of information, there is a set of domains set aside
                    specifically for this sort of use case, example.com, example.org,
                    example.net (in fact, just about any example.*). Being set aside for
                    this purpose, it is clear to readers that it is being a placeholder, and
                    doesn't accidentally step on someone else's domain.

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