Configuring the mail server
You need to configure your mail server to pass a copy of each received email (both incoming and outgoing) to piler via SMTP protocol.
Postfix
/etc/postfix/main.cf:
smtpd_recipient_restrictions = reject_non_fqdn_recipient, ..., \
check_recipient_access pcre:$config_directory/x-add-envelope-to, ...
always_bcc = archive@archive.example.com
/etc/postfix/x-add-envelope-to
/(.*)/ prepend X-Envelope-To: $1
Note that such configuration might reveal Bcc addresses to the recipients in the To/Cc fields. To prevent it happening piler features the HEADER_LINE_TO_HIDE config.php variable to automatically hide the X-Envelope-To: line.
When set (and the default is as seen below) it will hide such header lines from regular users on the GUI, only auditors are allowed to see all recipients, including the Bcc addresses.
$config['HEADER_LINE_TO_HIDE'] = 'X-Envelope-To:';
Exim
Add the following at the beginning of the routers-section:
begin routers
mailarchive:
debug_print = "R: mailarchive for $local_part@$domain"
driver = manualroute
domains = *
transport = remote_smtp
# piler listening on port 25:
route_list = * "archive.example.com::25"
self = send
unseen