email archiving

Discussion in 'Server Operation' started by Ovidiu, May 6, 2012.

  1. Ovidiu

    Ovidiu Active Member

    I've searched and found a couple of threads here asking the same question but no proper solution. Mostly these threads were a few years old so I am starting my own here.

    Basically I have clients hosting their emails with me that need to comply with certain regional laws which means 100% reliable storage of all incoming/outgoing emails. Lets not worry about how I back this up, for now I only need a solution for archiving.

    My base system runs ISPCFG3 with Debian Squeeze.

    Needed features:
    • archive all emails, incoming and outgoing on a per email domain basis

    Nice to have features:
    • web interface for searching and restoring from the archive into the original location
    • CLI for restoring from the archive into the original location

    What I have found so far:

    To be honest, the seemingly easiest solution from the ones I listed above seems to be this one: http://www.arschkrebs.de/postfix/postfix_archive.shtml but I admit I don't completely understand it.

    Does anyone here have a similar solution in place and is willing to share the details?
     
  2. dipeshmehta

    dipeshmehta Member

    you may use sender_bcc_maps and recipient_bcc_maps feature.

    For example: if you want bcc of all outgoing message, you may create a file with any name in /etc/postfix with something like this:
    Code:
    *@domain1.com mailaddress@domain1.com
    *@domain2.com mailaddress@domain2.com
    then run
    Code:
    postmap /etc/postfix/filename
    and
    add following line to /etc/postfix/main.cf
    Code:
    sender_bcc_maps = hash:/etc/postfix/filename
    Similar for recipient_bcc_maps.

    then, restart postfix

    You may find details at http://www.postfix.org/postconf.5.html
     
  3. Ovidiu

    Ovidiu Active Member

    Thanks, that looks like the other postfix URL I posted except you explained it better :)
    Will read through your link, give it a try and report back :)
     
  4. Ovidiu

    Ovidiu Active Member

    I think I already need help :)

    lets take sender_bcc_maps as an example:

    lets say I use:
    *@domain1.com mailaddress@domain1.com

    to collect a copy of all outgoing emails at that address. would that work even if I set that email address that collects all BCCs as inactive in ISPCFG3? I'd like to have it inactive as to not receive "normal" emails, would this postfix internal method still work?

    The documentation says:
    - what exactly do they mean by that?
     
  5. dipeshmehta

    dipeshmehta Member

    I am not using ISPC, so I am little unfamiliar with its config. Well, the suggested method is a feature of postfix, and it forwards bcc to the given address which is normal user account as others.[/QUOTE]

    you may create recipient account with some random string, to minimize chances of receiving normal mails. (e.g. sentlog.hf566412z@domain.com)
     
  6. Ovidiu

    Ovidiu Active Member

    I need to add a small correction to the above solution, you don't need
    , it doesn't even work. Skip it and all is good:

    Regarding other solutions, I contacted the author of one of the milters for archiving via psotfix: http://www.dancingfortune.com/projects/archivesmtp/index.php

    and he explained the advantage of using the milter vs sender_bcc_maps/recipient_bcc_maps as follows:

    One of the main issues with archiving SENT mail is that the user can essentially put any From: address they like. What we do to solve this problem is require that users must provide login credentials to send mail via smtp_auth. In this case the milter is able to see the username of the sender and determine where to archive it, regardless of what From: address is in the header. This is a case worth considering if the client requires the archive for legal reasons and not just backup purposes.

    Sounds right to me, I think this is a more "proper" solution, am I right?
     
  7. dipeshmehta

    dipeshmehta Member

    Sounds right to me too. Go ahead and post your experience here, all the best to you
     
  8. Ovidiu

    Ovidiu Active Member

    Thanks, will reply here if I reach a working config, that milter doesn't come with debian instructions so I am battling with it...
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    If you use a courier setup then you can archive the mails with a maildrop script, just add a rule to /var/vmail/.mailfilter to store a copy of all emails to a separate directory before delivering them to the mailbox.

    If you use dovecot then you can not store the emails to a folder directly as sive does not support that but you can forward them to a technical "archiving" address and also set flags in the mail header if you want to kep the original recipient address etc.
     
  10. Ovidiu

    Ovidiu Active Member

    Thanks, that is all great information but I realized one would need something else for a "proper" legal email archive so I had a look at open source systems but the only one I could find is enkive so I suggested it as a HowTo here: http://www.howtoforge.com/forums/showthread.php?t=57215
     

Share This Page