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

recipient_bcc_maps, sender_bcc_maps

Expand Messages
  • csere matyas
    hi i have a postfix set up with a bunch of virtual domains. we ve been using always_bcc to archive the mail, until one of the paranoid users asked us not to
    Message 1 of 5 , Mar 30, 2009
    • 0 Attachment
      hi

      i have a postfix set up with a bunch of virtual domains.
      we've been using always_bcc to archive the mail, until one of the
      paranoid users asked us not to include his mail in the archive.

      so i'm trying to do the same with recipient/sender maps:
      ----
      recipient_bcc_maps =
      pcre:/etc/postfix/recipient_bcc

      sender_bcc_maps = pcre:/etc/postfix/sender_bcc
      ----
      the contents of the two files are the same:
      ----
      /^paranoid\.user@my\.tld$)/
      null

      /.*/ mailbackup@...
      ----
      null points to /dev/null in my aliases file.

      if i enable only the recipient line, it works, his mail gets delivered
      to null and his mailbox.
      if i enable only the sender line, it works, mail sent from him, gets
      sent to null, and whoever.
      BUT, if i enable both rules, both his sent and recieved emails get archived!

      if i send mail to him it looks like this:
      ----
      Mar 31 00:20:17 machine postfix/qmgr[32425]: AE8C0258C056:
      from=<thesender@...>, size=341, nrcpt=1 (queue active)
      Mar 31 00:20:19 machine postfix/smtpd[32435]: connect from
      localhost[127.0.0.1]
      Mar 31 00:20:19 machine postfix/smtpd[32435]: 68EED258C0C1:
      client=localhost[127.0.0.1]
      Mar 31 00:20:19 machine postfix/cleanup[32430]: 68EED258C0C1:
      message-id=<20090330222013.AE8C0258C056@...>
      Mar 31 00:20:19 machine postfix/qmgr[32425]: 68EED258C0C1:
      from=<thesender@...>, size=791, nrcpt=3 (queue active)
      Mar 31 00:20:19 machine postfix/smtpd[32435]: disconnect from
      localhost[127.0.0.1]
      Mar 31 00:20:19 machine amavis[31260]: (31260-09) Passed CLEAN, LOCAL
      [127.0.0.1] [127.0.0.1] <thesender@...> -> <paranoid.user@...>,
      Message-ID: <20090330222013.AE8C0258C056@...>, mail_id:
      SQovFKE8WLMy, Hits: -100.418, size: 341, queued_as: 68EED258C0C1, 1956 ms
      Mar 31 00:20:19 machine postfix/smtp[32432]: AE8C0258C056:
      to=<paranoid.user@...>, relay=127.0.0.1[127.0.0.1]:10024, delay=8.2,
      delays=6.3/0/0/2, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=31260-09,
      from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 68EED258C0C1)
      Mar 31 00:20:19 machine postfix/qmgr[32425]: AE8C0258C056: removed
      Mar 31 00:20:19 machine postfix/local[32437]: 68EED258C0C1:
      to=<null@...>, relay=local, delay=0.02, delays=0.01/0.01/0/0,
      dsn=2.0.0, status=sent (delivered to file: /dev/null)
      Mar 31 00:20:19 machine postfix/virtual[32436]: 68EED258C0C1:
      to=<paranoid.user@...>, relay=virtual, delay=0.04,
      delays=0.01/0.01/0/0.03, dsn=2.0.0, status=sent (delivered to maildir)
      Mar 31 00:20:19 machine postfix/virtual[32436]: 68EED258C0C1:
      to=<mailbackup@...>, relay=virtual, delay=0.05,
      delays=0.01/0.01/0/0.03, dsn=2.0.0, status=sent (delivered to maildir)
      Mar 31 00:20:19 machine postfix/qmgr[32425]: 68EED258C0C1: removed
      ----
      if he sends mail:
      Mar 31 00:25:17 machine postfix/qmgr[32425]: D3871258C056:
      from=<paranoid.user@...>, size=341, nrcpt=1 (queue active)
      Mar 31 00:25:19 machine postfix/smtpd[32451]: connect from
      localhost[127.0.0.1]
      Mar 31 00:25:19 machine postfix/smtpd[32451]: F1719258C05F:
      client=localhost[127.0.0.1]
      Mar 31 00:25:19 machine postfix/cleanup[32446]: F1719258C05F:
      message-id=<20090330222510.D3871258C056@...>
      Mar 31 00:25:19 machine postfix/smtpd[32451]: disconnect from
      localhost[127.0.0.1]
      Mar 31 00:25:19 machine postfix/qmgr[32425]: F1719258C05F:
      from=<paranoid.user@...>, size=777, nrcpt=3 (queue active)
      Mar 31 00:25:19 machine postfix/local[32469]: F1719258C05F:
      to=<null@...>, relay=local, delay=0.01, delays=0.01/0/0/0,
      dsn=2.0.0, status=sent (delivered to file: /dev/null)
      Mar 31 00:25:20 machine amavis[31260]: (31260-10) Passed CLEAN, LOCAL
      [127.0.0.1] [127.0.0.1] <paranoid.user@...> -> <therecipient@...>,
      Message-ID: <20090330222510.D3871258C056@...>, mail_id:
      Vnqab68tzpSu, Hits: -100.429, size: 341, queued_as: F1719258C05F, 2060 ms
      Mar 31 00:25:20 machine postfix/smtp[32447]: D3871258C056:
      to=<therecipient@...>, relay=127.0.0.1[127.0.0.1]:10024, delay=14,
      delays=12/0/0/2.1, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=31260-10,
      from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as F1719258C05F)
      Mar 31 00:25:20 machine postfix/qmgr[32425]: D3871258C056: removed
      Mar 31 00:25:20 machine postfix/virtual[32452]: F1719258C05F:
      to=<therecipient@...>, relay=virtual, delay=0.03,
      delays=0.01/0/0/0.02, dsn=2.0.0, status=sent (delivered to maildir)
      Mar 31 00:25:20 machine postfix/virtual[32452]: F1719258C05F:
      to=<mailbackup@...>, relay=virtual, delay=0.04, delays=0.01/0/0/0.03,
      dsn=2.0.0, status=sent (delivered to maildir)
      Mar 31 00:25:20 machine postfix/qmgr[32425]: F1719258C05F: removed
      ----
      so it does do the forwarding to null as it should, but why on earth does
      it end up in the backup too?

      anyone could hit me with a clue-by-four? [=


      thanks in advance,
      wd
    • Victor Duchovni
      ... What happens to the null recipient after it goes through amavis? Don t enable bcc rewriting on both sides of the content filter. -- Viktor. Disclaimer:
      Message 2 of 5 , Mar 31, 2009
      • 0 Attachment
        On Tue, Mar 31, 2009 at 12:34:21AM +0200, csere matyas wrote:

        > so i'm trying to do the same with recipient/sender maps:
        > ----
        > recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc
        >
        > sender_bcc_maps = pcre:/etc/postfix/sender_bcc
        > ----
        > the contents of the two files are the same:
        > ----
        > /^paranoid\.user@my\.tld$)/ null
        >
        > /.*/ mailbackup@...
        > ----
        > null points to /dev/null in my aliases file.

        What happens to the "null" recipient after it goes through amavis?
        Don't enable "bcc" rewriting on both sides of the content filter.

        --
        Viktor.

        Disclaimer: off-list followups get on-list replies or get ignored.
        Please do not ignore the "Reply-To" header.

        To unsubscribe from the postfix-users list, visit
        http://www.postfix.org/lists.html or click the link below:
        <mailto:majordomo@...?body=unsubscribe%20postfix-users>

        If my response solves your problem, the best way to thank me is to not
        send an "it worked, thanks" follow-up. If you must respond, please put
        "It worked, thanks" in the "Subject" so I can delete these quickly.
      • Noel Jones
        ... Of course it s archived - unless he s both the sender and recipient. You can use a policy server that checks {sender, recipient} and returns BCC
        Message 3 of 5 , Mar 31, 2009
        • 0 Attachment
          csere matyas wrote:
          > hi
          >
          > i have a postfix set up with a bunch of virtual domains.
          > we've been using always_bcc to archive the mail, until one of the
          > paranoid users asked us not to include his mail in the archive.
          >
          > so i'm trying to do the same with recipient/sender maps:
          > ----
          > recipient_bcc_maps =
          > pcre:/etc/postfix/recipient_bcc
          >
          > sender_bcc_maps = pcre:/etc/postfix/sender_bcc
          > ----
          > the contents of the two files are the same:
          > ----
          > /^paranoid\.user@my\.tld$)/
          > null
          >
          > /.*/ mailbackup@...
          > ----
          > null points to /dev/null in my aliases file.
          >
          > if i enable only the recipient line, it works, his mail gets delivered
          > to null and his mailbox.
          > if i enable only the sender line, it works, mail sent from him, gets
          > sent to null, and whoever.
          > BUT, if i enable both rules, both his sent and recieved emails get
          > archived!

          Of course it's archived - unless he's both the sender and
          recipient.

          You can use a policy server that checks {sender, recipient}
          and returns "BCC whatever@..." if Mr. Paranoid isn't
          found. This may be tricky since the policy protocol doesn't
          report a full list of recipients, only the "current" recipient.

          Better solution is to bcc everything and use a delivery filter
          (procmail or whatever) to throw away mail this is neither to
          nor from him.

          But what about mail from him to someone who needs to be
          archived? or vice versa? What about multi-recipient mail to
          him plus someone that must be archived? Can't solve all these
          problems in an MTA.

          BTW, you can use "DUNNO" as the result in a pcre table to
          pretend the string wasn't found. No need to use a "null" alias.

          -- Noel Jones
        • Victor Duchovni
          ... No, this is wrong. DUNNO is an access(5) action, which has no special meaning in address rewriting tables. -- Viktor. Disclaimer: off-list followups get
          Message 4 of 5 , Mar 31, 2009
          • 0 Attachment
            On Tue, Mar 31, 2009 at 09:57:12AM -0500, Noel Jones wrote:

            > BTW, you can use "DUNNO" as the result in a pcre table to pretend the
            > string wasn't found. No need to use a "null" alias.

            No, this is wrong. DUNNO is an access(5) action, which has no special
            meaning in address rewriting tables.

            --
            Viktor.

            Disclaimer: off-list followups get on-list replies or get ignored.
            Please do not ignore the "Reply-To" header.

            To unsubscribe from the postfix-users list, visit
            http://www.postfix.org/lists.html or click the link below:
            <mailto:majordomo@...?body=unsubscribe%20postfix-users>

            If my response solves your problem, the best way to thank me is to not
            send an "it worked, thanks" follow-up. If you must respond, please put
            "It worked, thanks" in the "Subject" so I can delete these quickly.
          • csere matyas
            ... thanks for the hints, i think ill go with always_bcc/procmail.
            Message 5 of 5 , Apr 1, 2009
            • 0 Attachment
              Victor Duchovni wrote:
              > On Tue, Mar 31, 2009 at 09:57:12AM -0500, Noel Jones wrote:
              >
              >
              >> BTW, you can use "DUNNO" as the result in a pcre table to pretend the
              >> string wasn't found. No need to use a "null" alias.
              >>
              >
              > No, this is wrong. DUNNO is an access(5) action, which has no special
              > meaning in address rewriting tables.
              >
              thanks for the hints, i think ill go with always_bcc/procmail.
            Your message has been successfully submitted and would be delivered to recipients shortly.