Want to save all outgoing email to read later...

RandyL712

Well-Known Member
Jul 31, 2002
69
0
156
I have a customer who wants to monitor all outgoing email (to see what his employees are sending their customers). What's the easiest way to set this up? If it's possible, probably invisibly forwarding all outgoing email to his private email box would work.
 

JPC-Martin

Active Member
PartnerNOC
May 31, 2008
37
1
58
Some webmail and mail clients like Horde provide option to cc every outgoing mail automatically.

There is another way to check outgoing emails from some specific email/domain that is check email logs from server and read their body but this is tough job and you must have root access for this.

Also there is many software availble on the internet , do this job efficiently. i.e Spector CNE , you can also google on such tools
 

RandyL712

Well-Known Member
Jul 31, 2002
69
0
156
I may not have explained the need well.

We host a domain - DOMAIN.com - and the owner of that company wants to be able to read every outoging email his employees send, so that he can monitor the level of customer service they're providing.

And of course, we want to do it as easily as possible. If it's possibly to secretly forward every outgoing email into a private email box that he has access to, or something like that, that'd be perfect. We're open to other suggestions on how to accomplish this.

Thanks!
 

Vinayak

Well-Known Member
Jun 27, 2003
281
2
168
Bharat
cPanel Access Level
Root Administrator
Login to WHM as root:

Main >> Service Configuration >> Exim Configuration Editor

Check the name & location of "System Filter File", mine is at
/usr/local/cpanel/base/eximacl/antivirusandspam.exim

Now edit this file in your favorite editor and insert this code:

For collecting outgoing mails only

Code:
### START OF OUTGOING MAIL FORWARDING ###

if first_delivery
   and ("$h_from:" contains "[email protected]")
then
   unseen deliver "[email protected]"
endif 

### END OF OUTGOING MAIL FORWARDING ###
For collecting both outgoing and incoming mails:

Code:
### START OF OUTGOING + INCOMING MAIL FORWARDING ###

if first_delivery
   and ("$h_to:, $h_cc:" contains "[email protected]")
   or ("$h_from:" contains "[email protected]")
then
   unseen deliver "[email protected]"
endif

### END OF OUTGOING + INCOMING MAIL FORWARDING ###
Above method will silently/invisibly forward mails to the mail ID [email protected] (change it to actual mail ID where you want all the mails to be delivered, this could be an internal or external mail ID)

Chane [email protected] to actual mail ID that is to be monitored.

You have to make one entry per user between the comments.

Like I have

Code:
### START OF OUTGOING + INCOMING MAIL FORWARDING Company-1###
Entry - 1

Entry - 2

Entry - 3
### END OF OUTGOING + INCOMING MAIL FORWARDING Company-1 ###

### START OF OUTGOING + INCOMING MAIL FORWARDING Company-2###
Entry - 1

Entry - 2

Entry - 3
### END OF OUTGOING + INCOMING MAIL FORWARDING Company-2 ###
Important: If the system filter mentioned in WHM is "/etc/cpanel_exim_system_filter_custom" change it to something like "/etc/cpanel_exim_system_filter_custom", otherwise cPanel update will overwrite it.

Don't forget to restart Exim.
 
Last edited:

RandyL712

Well-Known Member
Jul 31, 2002
69
0
156
Where in the file should that code be placed? I put it at the bottom and it didn't work.

Also - can I simply put a domain name to catch all emails? such as:
Code:
### START OF OUTGOING + INCOMING MAIL FORWARDING ###

if first_delivery
   and ("$h_to:, $h_cc:" contains "@domain.com")
   or ("$h_from:" contains "@domain.com")
then
   unseen deliver "[email protected]"
endif

### END OF OUTGOING + INCOMING MAIL FORWARDING ###
I want to catch ALL email to/from this domain. (From being most important)

THANK YOU!
 

Vinayak

Well-Known Member
Jun 27, 2003
281
2
168
Bharat
cPanel Access Level
Root Administrator
You must already be having an entry

Code:
if not first_delivery
then
  finish
endif
So put the filter code below that. Save the file, and restart exim

HTML:
service exim restart
Yes you can use "@domain.com"
 

sphost

Well-Known Member
Jan 19, 2004
59
0
156
Important: If the system filter mentioned in WHM is "/etc/cpanel_exim_system_filter_custom" change it to something like "/etc/cpanel_exim_system_filter_custom", otherwise cPanel update will overwrite it.

Don't forget to restart Exim.

can you tell me how to do it either through WHM or ssh?

thanks
 

crazyaboutlinux

Well-Known Member
Nov 3, 2007
939
1
66
this script is only a part of particular domain e.g domain.com but what about other domains which are hosted & if they want same

in my server there are more than 150 domains are hosted e.g mydomain.com , mydomain.org , testdomain.com , testing.com

In mydomain.com there 5 email accounts
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

all email which are sent from those ids must be copy to [email protected]

same thing for testdomain.com
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]ain.com

all email which are sent from those ids must be copy to [email protected]

same thing for testing.com , mydomain.org
 

crazyaboutlinux

Well-Known Member
Nov 3, 2007
939
1
66

Vinayak

Well-Known Member
Jun 27, 2003
281
2
168
Bharat
cPanel Access Level
Root Administrator
See the examples I have given above, if you want to forward all the emails on a domain you don't have to make entry for each and every email, but if you just want to monitor an specific email ID or not all email accounts on that domain then you have to make entry for all those email IDs.

The same is to be repeated for the second domain.

Take hint from http://forums.cpanel.net/481941-post4.html
 

furquan

Well-Known Member
Jul 27, 2002
473
4
168
very helpful :)

Very Very helpful...

Vinsar, do you have any more tips and tricks to share ;) for the novice like us :)

Happy New Year !!!!!!!!!!!
 

Vinayak

Well-Known Member
Jun 27, 2003
281
2
168
Bharat
cPanel Access Level
Root Administrator
Well to be frank I just search for answers, discuss with others when I need something. And post the answer if I know it.

So when you need something just post it on the forums, 99% time you will get the solution.

Happy New Year.
 

l00ph0le

Member
Aug 16, 2007
23
0
51
Looking to do this, but having trouble looking for the necessary files with 11.25 and just cant seem to do it...Any advice would be nice.