Saturday, March 11, 2017

Copy all Incoming Outgoing Emails - Employee monitor

How can we monitor employee's email conversations ?

If we are running company, It's too impotent to monitoring employee's email conversations which is traveled by company domain name. If you are using WHM with Exim mail server, it's too easy.

Let's consider "domain.com" is your company domain, you have 50's of mail IDs. You are having a mail ID "monitor@domain.com" and you need to archive / monitor all your mails incoming and outgoing mails to "monitor@domain.com".

To do this, you must have access to server with ssh (root access) and WHM (root access).

1. "/usr/local/cpanel/etc/exim/sysfilter/options" is path where you can store all custom filters.

#cd /usr/local/cpanel/etc/exim/sysfilter/options

2. Create a empty file for store your filter rules. You can create as much of filter as you want, so create a file with understandable name with domain name, replace domain_com to your company domain name.

#vim incoming_outgoing_domain_com

3. Copy paste bellow code to this file and replace "domain.com" to your company domain name and "monitor@domain.com" to your mail that you created for archive all mails,

For incoming mails only,

if ("$h_to:, $h_cc:, $h_bcc" contains "domain.com")
then
     unseen deliver "monitor@domain.com"
endif

For outgoing mails only,

if $sender_address: contains "domain.com"
then
     unseen deliver "monitor@domain.com"
endif

For incoming and outgoing mails,

if ("$h_to:, $h_cc:, $h_bcc" contains "domain.com")
   or ("$sender_address:" contains "domain.com")
then
   unseen deliver "monitor@domain.com"
endif


Note: Forwarding to other domains, outside server won't work.

No comments: