Thursday 24 November 2011

cPanel + exim + Forward outgoing mail to another mail

Do you want blind CC all incoming and outgoing emails from any domain to user@domain.com account? If that is the case, then I can tell you how to do it on a per domain basis:

1. To create a blind carbon copy, go to /etc/ and create a new file:


Code:
cp cpanel_exim_system_filter cpanel_exim_system_filter2
2. Add the following at the bottom of the new file (/etc/cpanel_exim_system_filter2):


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

if $sender_address: contains "domain.com"
then
unseen deliver "user@domain.com"
endif
Now, go to WHM > Exim Configuration Editor and change the system filter to the new path (/etc/cpanel_exim_system_filter2).

Above, please replace domain.com with the domain name you want to have all emails incoming and outgoing sent to the blind carbon copied address. Please ensure the receiving address for the incoming and outgoing emails is not on the same domain as those you are using for the forwarding, since you might end up creating some type of loop otherwise.

No comments: