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

virtual_alias_maps, catchalls, X-Original-To, and null results (second try)

Expand Messages
  • djonas@vitalwerks.com
    Hello, ... Let me apologize for my previous post. I assume my cold reception was due to accidentally hijacking a thread. No good excuses, I just made a
    Message 1 of 3 , Oct 2, 2006
    • 0 Attachment
      Hello,

      ----

      Let me apologize for my previous post. I assume my cold reception was
      due to accidentally hijacking a thread. No good excuses, I just made
      a mistake. I apologize. I've also updated the original post below
      with cut-and-paste information directly from the files. Thanks for
      your time.

      ----

      I've implemented forwarding and aliases for my users using the
      virtual_alias_maps. This worked exceedingly well, except for a couple
      side effects.

      First, catchalls are implemented as below:

      outside@...
      david.jonas@...,splitretina@...
      @... welcome@...

      There are also entries in transport_maps such as this:

      # sa is a pipe transport to a simple perl script for local delivery
      djonas@... sa:splitretina.com
      welcome@... sa:splitretina.com

      This worked just fine with mysql maps because I could specify a null
      return if djonas@... was found in the virtual_alias
      table, thus never invoking the catchall. I've since moved to hash
      files for better performance (and less maintenance overhead). My
      solution to the null lookup problem came to me like an angel and
      seemed to work quite nicely. Basically, add a redundant entry to
      virtual_alias_maps. Postfix notices the loop and stops looking
      (cleanup_map1n.c, lines: ~109,~131). My new virtual_alias_maps looks
      like this:

      outside@...
      david.jonas@...,splitretina@...
      djonas@... djonas@...
      welcome@... welcome@...
      @... welcome@...


      This works, but when sending to djonas@... I get

      ... Delivered: status=success, orig=<djonas@...>,
      to=<djonas@...>, ...

      in my logs and an X-Original-To line in the headers. The extra
      logging and header lines don't bother me, but it means the X-Original-
      To line will be rewritten in the case of a second pass (as described
      in the second problem below).

      So the first question is, Is there a value or procedure for an entry
      in the virtual_alias_maps that can make cleanup think that it found
      no entry in the map?

      The second problem is the impetus for the post:

      Incoming mail is fed through a a content_filter. Before that happens
      cleanup has written an X-Original-To header line. When the
      content_filter injects that message back into Postfix and cleanup
      processes the virtual_alias_maps as above it rewrites the X-Original-
      To line with the redundant entry (http://www.postfix.org/postconf.
      5.html#enable_original_recipient)! Of course this is no fault of
      postfix/cleanup's and is in fact an aptly named system. But what to do!

      Solving the first problem solves the second, though I'll take any
      hack to make my users happy. The frustration for them lies in not
      being able to filter their aliases to different boxes on the X-
      Original-To header line.


      Any help or advice would be greatly appreciated.

      Regards,

      David
    • Wietse Venema
      ... You can configure the Postfix pipe(8) mailer not to write X-Original-To headers. man 8 pipe. Wietse
      Message 2 of 3 , Oct 2, 2006
      • 0 Attachment
        djonas@...:
        > The second problem is the impetus for the post:
        >
        > Incoming mail is fed through a a content_filter. Before that happens
        > cleanup has written an X-Original-To header line. When the

        You can configure the Postfix pipe(8) mailer not to write X-Original-To
        headers. man 8 pipe.

        Wietse
      • djonas@vitalwerks.com
        ... I didn t think that would work when I saw it originally, but it works quite well! Thanks for the help. For posterity, the new master.cf lines look like
        Message 3 of 3 , Oct 2, 2006
        • 0 Attachment
          On Oct 2, 2006, at 12:29 PM, Wietse Venema wrote:

          > djonas@...:
          >> The second problem is the impetus for the post:
          >>
          >> Incoming mail is fed through a a content_filter. Before that happens
          >> cleanup has written an X-Original-To header line. When the
          >
          > You can configure the Postfix pipe(8) mailer not to write X-
          > Original-To
          > headers. man 8 pipe.
          >
          > Wietse

          I didn't think that would work when I saw it originally, but it works
          quite well! Thanks for the help.

          For posterity, the new master.cf lines look like this), prepend "on"
          for the first pipe, prepend "off" for the second.

          avcheck unix - n n - 100 pipe
          flags=Oq user=avcheck argv=/usr/bin/avcheck
          -d /var/spool/avcheck -s Clamav:/tmp/clamd
          -f ${sender} -S :10025 -- ${recipient}

          sa unix - n n - 30 pipe
          flags=DRhuq user=nobody argv=/home/scripts/agents/lda -h $
          {nexthop} -u ${user} -f ${sender} -s ${size}

          Thanks again.

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