HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   email archiving (http://www.howtoforge.com/forums/showthread.php?t=57199)

Ovidiu 6th May 2012 12:31

email archiving
 
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?

dipeshmehta 7th May 2012 09:54

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

Ovidiu 7th May 2012 10:56

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 :-)

Ovidiu 7th May 2012 11:05

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:
Quote:

The BCC address (multiple results are not supported)
- what exactly do they mean by that?

dipeshmehta 7th May 2012 11:32

Quote:

Originally Posted by Ovidiu (Post 278715)
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 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]

Quote:

Originally Posted by Ovidiu (Post 278715)
I'd like to have it inactive as to not receive "normal" emails, would this postfix internal method still work?

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

Ovidiu 7th May 2012 12:00

I need to add a small correction to the above solution, you don't need
Quote:

*
, it doesn't even work. Skip it and all is good:

Quote:

@domain1.com mailaddress@domain1.com
Regarding other solutions, I contacted the author of one of the milters for archiving via psotfix: http://www.dancingfortune.com/projec...smtp/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?

dipeshmehta 8th May 2012 07:20

Quote:

Originally Posted by Ovidiu (Post 278721)
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?

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

Ovidiu 8th May 2012 11:27

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

till 8th May 2012 11:48

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.

Ovidiu 9th May 2012 09:37

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


All times are GMT +2. The time now is 06:32.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.