Monitoring Inbound and Outbound email for Specific Users

Document ID: 10415

Synopsis

To monitor a user account it is possible to set up a sieve filter to capture mail to and from their account. This then can be used to redirect the mail to an account for administration purpo

More Information

Monitoring Inbound and Outbound email for Specific Users To monitor a user account it is possible to set up a sieve filter to capture mail to and from their account. This then can be used to redirect the mail to an account for administration purposes.

A Server Receive Script needs to be made to capture these emails. Only a 'Server Receive Script' filter processes all mail that is received and sent. This way you can guarantee that all mail that goes in and out can be redirected to another account.

If you are monitoring several users accounts we recommend that you create a separate filter for each user. This will make administration easier at a later date.

Setup Steps

  • Go to Server > Filtering > Sieve Filter > Server Receive Script
  • Click Advanced
  • Under the 'Require' statement on a new line paste this code:

    /* RuleName: Capture messages
    RuleDescription: Captures messages from one users account for monitoring
    */
    if anyof (
    header :contains "To" "test@domain.com",
    header :contains "Cc" "test@domain.com",
    header :contains "From" "test@domain.com"
    ) {
    redirect "monitor@domain.com";
    }

  • Click OK
  • Click OK again
  • Click Close

Alter the code snippet above replacing the email address you wish to monitor as well as the mail box where the mail will be redirected to. In the example given mail to and from test@domain.com is redirected to monitor@domain.com. The same rule can be created using the wizard (invoked by clicking New).

This rule must be placed as high as possible in the 'Server Receive Scripts'