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

backup every incoming mail to file

Expand Messages
  • Leo
    Hello, we want to replace our current mail server (sendmail) with a new one (postfix). For security reasons we want to make a backup of every incoming mail
    Message 1 of 4 , Jul 1, 2008
    • 0 Attachment
      Hello,

      we want to replace our current mail server (sendmail) with a new one
      (postfix). For security reasons we want to make a backup of every
      incoming mail (including envelope information) to the filesystem (simple
      text file, e.g. mails_2008-07-01.txt, ...).

      Current setup:
      postfix + amavisd-new + clamav + spamassassin

      Postfix receives mail for a virtual domain, delivers it through the
      "content_filter" parameter to amavisd-new (clamav+spamassassin) and gets
      it back from amavisd-new on a second smtpd daemon. This is the default
      setup for amavisd-new.

      Our problem is to save every mail BEFORE it will be filtered by
      amavisd-new. Is there a possibility to do this? Or is the only way to
      patch the amavisd-new source code?

      Any help would be highly appreciated!

      Kind regards,
      Leo
    • mouss
      ... why? why not configure your amavisd-new to pass all mail so that you can do the copy AFER filtering. This is simpler and has the advantage of putting the
      Message 2 of 4 , Jul 1, 2008
      • 0 Attachment
        Leo wrote:
        > Hello,
        >
        > we want to replace our current mail server (sendmail) with a new one
        > (postfix). For security reasons we want to make a backup of every
        > incoming mail (including envelope information) to the filesystem
        > (simple text file, e.g. mails_2008-07-01.txt, ...).
        >
        > Current setup:
        > postfix + amavisd-new + clamav + spamassassin
        >
        > Postfix receives mail for a virtual domain, delivers it through the
        > "content_filter" parameter to amavisd-new (clamav+spamassassin) and
        > gets it back from amavisd-new on a second smtpd daemon. This is the
        > default setup for amavisd-new.
        >
        > Our problem is to save every mail BEFORE it will be filtered by
        > amavisd-new.

        why? why not configure your amavisd-new to pass all mail so that you can
        do the copy AFER filtering. This is simpler and has the advantage of
        putting the filter decison (amavisd-new and SA headers) in the archived
        copy.

        > Is there a possibility to do this? Or is the only way to patch the
        > amavisd-new source code?

        you can use recipient_bcc_maps with pcre: something like

        /(.)/ $1@...

        but you need some care (think of enabled/disabled address rewrite,
        loops, ... etc).

        you may need to setup an additionnal smtpd (with its own cleanup
        service) before amavisd-new.
      • Magnus Bäck
        On Tuesday, July 01, 2008 at 17:45 CEST, mouss wrote: [...] ... ITYM /(.*)/ $1@bcc.example.com [...] -- Magnus Bäck
        Message 3 of 4 , Jul 1, 2008
        • 0 Attachment
          On Tuesday, July 01, 2008 at 17:45 CEST,
          mouss <mouss@...> wrote:

          [...]

          > you can use recipient_bcc_maps with pcre: something like
          >
          > /(.)/ $1@...

          ITYM

          /(.*)/ $1@...

          [...]

          --
          Magnus Bäck
          magnus@...
        • Victor Duchovni
          ... This is fine with recipient_bcc_maps, where the lookup key is in internal form . If one wants to use similar rewriting with virtual alias maps, one needs
          Message 4 of 4 , Jul 1, 2008
          • 0 Attachment
            On Tue, Jul 01, 2008 at 10:26:47PM +0200, Magnus B?ck wrote:

            > On Tuesday, July 01, 2008 at 17:45 CEST,
            > mouss <mouss@...> wrote:
            >
            > [...]
            >
            > > you can use recipient_bcc_maps with pcre: something like
            > >
            > > /(.)/ $1@...
            >
            > ITYM
            >
            > /(.*)/ $1@...

            This is fine with recipient_bcc_maps, where the lookup key is in "internal
            form". If one wants to use similar rewriting with virtual alias maps,
            one needs to be careful with quotes:

            if !/@example\.net$/
            /"(.*)"@example\.com$/ "${1}@..."@...
            /(.*)@example\.com$/ ${1}@example.com@...
            endif

            In this context (virtual_alias_maps), lookups are recursive, so it is
            easy to get loops, make sure the RHS address is exempt from the rewrite.

            --
            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.
          Your message has been successfully submitted and would be delivered to recipients shortly.