Howto track cpanel+exim server outgoing mails

March 8th, 2007

I wanted to track some outgoing mails in my servers. Initially I was using IMAP to solve this issue. Then It was becoming slow everyday. They started complaining that the mail was really slow. I was forced to move to POP3 which is much faster compared to IMAP. Once I activated POP3 tracking was out of my hands. I search a lot on how to play with filters in exim mail.

It is quite powerful and give total control on incoming and outgoing mails. To solve my problem I need to play only with outgoing mails. There is a file named /etc/antivirus.exim is the file we need to play with. I edited the file and added the below lines to make it work for me.

if first_delivery
and ( ("$h_from:" contains "test1@imthi.com")
or ("$h_from:" contains "test2@imthi.com")
or ("$h_from:" contains "test3@imthi.com")
)
then
unseen deliver "tracker@imthi.com"
endif

The above block checks if the outgoing mail is on first delivery and who is the sender. Based on the sender I am sending a bcc copy to another mailbox. You can play more by studying the exim filter commands more ;-)

Linux

  1. April 10th, 2008 at 22:55 | #1

    where we hav to put

    if first_delivery
    and ( (”$h_from:” contains “test1@imthi.com”)
    or (”$h_from:” contains “test2@imthi.com”)
    or (”$h_from:” contains “test3@imthi.com”)
    )
    then
    unseen deliver “tracker@imthi.com”
    endif

    what file ?

  2. April 11th, 2008 at 00:12 | #2

    i try to put your code into /etc/antivirus.exim but dont work !! in what line we have to put ??

    this ist my /etc/antivirus.exim

    http://pastebin.com/fb1d313e

  3. November 4th, 2008 at 19:03 | #3

    For cpanel 11 you need to edit the file

    /etc/cpanel_exim_system_filter

    not

    /etc/antivirus.exim

  4. aboali
    January 3rd, 2009 at 07:50 | #4

    um, for outgoing (outbound) email, i think it shout be “$h_to:” instead of ”$h_from:”, at least that’s how it worked for me.

  5. February 8th, 2009 at 17:13 | #5

    it worked for me. Thank you dude

  6. February 23rd, 2009 at 12:16 | #6

    Where can we access this file in Cpanel 11
    etc/cpanel_exim_system_filter
    Is it in file manager?

    Pls help

  7. February 26th, 2009 at 16:34 | #7

    anyone?? I want to track my outgoing mails..pls help . I have a shared hosting account .

  8. jan
    April 29th, 2009 at 13:26 | #8

    If you have root access in your cpanel then you can edit that file.

    If not then try editing the user filter instead the system filter.

  1. No trackbacks yet.