Forward all outgoing and incoming emails for the domain to an email account:–
If you wish to have such configuration, where all the e-mails sent and received from the domain does gets stored/delivered to any specific e-mail address, you may configure the exim configuration as follows :-
Go to WHM > Exim Configuration Editor and see the system filter path, default will be (/etc/cpanel_exim_system_filter).
Open the file and add the following at the end of the file,
=-=-=-=-=-=-=-=-=--==--==-=-=-=-=-=-=-=-=-=-
if (“$h_to:, $h_cc:, $h_bcc” contains “<domain.com>”)
then
unseen deliver "<mail account>"
endif
if $sender_address: contains "<domain.com>"
then
unseen deliver "<mail account>"
endif
=-=-=-=--=-==-=-=-=-=-=--==-=-=-=--=-=-==--==-=-=-
There is an alternate script which could do the same,
=-=-=-=-=-=-=--==--=-=-==-=--=-=-==-=-
if ( foranyaddress $reply_address,$return_path,$sender_address,$header_from,$h_from,$h_to:,$h_cc:,$h_bcc:,$recipients
( $thisaddress contains @<domain.com> )) and ( $header_X-Ref-Type does not contain yes )
then
headers add "X-Ref-Type: yes\n"
unseen deliver <gmail account>
endif
=-=-=-=-=-=-=--==-=-=-=-=--==--=-==-=-=-=-
Note : Replace
<domain.com> with your domain and
<email account> with the email account
Done
If you wish to have such configuration, where all the e-mails sent and received from the domain does gets stored/delivered to any specific e-mail address, you may configure the exim configuration as follows :-
Go to WHM > Exim Configuration Editor and see the system filter path, default will be (/etc/cpanel_exim_system_filter).
Open the file and add the following at the end of the file,
=-=-=-=-=-=-=-=-=--==--==-=-=-=-=-=-=-=-=-=-
if (“$h_to:, $h_cc:, $h_bcc” contains “<domain.com>”)
then
unseen deliver "<mail account>"
endif
if $sender_address: contains "<domain.com>"
then
unseen deliver "<mail account>"
endif
=-=-=-=--=-==-=-=-=-=-=--==-=-=-=--=-=-==--==-=-=-
There is an alternate script which could do the same,
=-=-=-=-=-=-=--==--=-=-==-=--=-=-==-=-
if ( foranyaddress $reply_address,$return_path,$sender_address,$header_from,$h_from,$h_to:,$h_cc:,$h_bcc:,$recipients
( $thisaddress contains @<domain.com> )) and ( $header_X-Ref-Type does not contain yes )
then
headers add "X-Ref-Type: yes\n"
unseen deliver <gmail account>
endif
=-=-=-=-=-=-=--==-=-=-=-=--==--=-==-=-=-=-
Note : Replace
<domain.com> with your domain and
<email account> with the email account
Done