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.