MithiDocs

Step 3: Enable Email Archiving for CPanel Users

To archive mail from your primary domain hosted on CPanel, you need to configure filters. These filters forward mail from your primary server to the Vaultastic server.

To configure forwarding, you need to login to the Exim server using SSH. It is required to configure the following filters to archive mail on Vaultastic.

  1. Filter to forward a copy of received mail to archive account

  2. Filter to forward a copy of sent mail to archive account

A. Create a filter to forward a copy of received mail to the archive account

To configure a filter to forward a copy of received mail, you need to create a file /etc/valiases/. This file will contain the rule for forwarding a copy of received mail to Vaultastic.

For example, to configure the filter to forward all received mail on the domain baya.in to its corresponding Vaultastic domain, create a file /etc/valiases/baya.in

  1. Open the file /etc/valiases/ in vi editor

    vi /etc/valiases/
    
    For example:
    vi /etc/valiases/baya.in
  2. Add all the user ids as per the format mentioned below

    {userid}@{domainname}: {userid}@{domainprefix}.vaultastic.com
    
    For example,
    To forward mail received from users amit and deepa on the baya.in domain, add lines mentioned below
    amit@baya.in: amit@baya-in.vaultastic.com
    deepa@baya.in: deepa@baya-in.vaultastic.com
  3. Save the file

B. Create a filter to forward a copy of sent mail to the archive account

To configure a filter to forward a copy of sent mail, you need to create a file /etc/cpanel_exim_system_filter2. This file will contain the rule for forwarding all sent mail to Vaultastic.

Once the file is created, you need to set this fie to the Systems Filter from the Web Host Manager interface.

  1. Create the cpanel_exim_system_filter2 file

    1. Login to the server using ssh

    2. Make a copy of the System Filter file using the command mentioned below

      cp /etc/cpanel_exim_system_filter /etc/cpanel_exim_system_filter2

      Open the System Filter file in the vi editor

      vi /etc/cpanel_exim_system_filter2
    3. Add user details for whom you want to enable archiving in the format mentioned below

      if $sender_address: contains “{userid}@{domainname}”
      then
      unseen deliver “$sender_address_local_part@{domainprefix}.vaultastic.com”
      endif
      
      For Example:
      If you need to enable archiving for the users amit and deepa’ on the baya.in domain, 
      enter the following lines in the filter file.
      
      if $sender_address: contains “amit@baya.in”
      then
      unseen deliver “$sender_address_local_part@baya-in.vaultastic.com”
      endif
      if $sender_address: contains “deepa@baya.in”
      then
      unseen deliver “$sender_address_local_part@baya-in.vaultastic.com”
      endif
    4. Save the file

    5. Set the System Filter file from WHM interface
    6. Set the System Filter file to /etc/cpanel_exim_system_filter2

  1. Login to WEB HOST MANAGER using valid credentials.

  1. From the left panel search box, search for exim. This will navigate you to the Exim Configuration Manager section quickly.

  1. Click the Exim Configuration Manager button.

  1.  Select the Basic Editor tab
  2. Locate the System Filter File section
  3. Select the Edit option and paste the string as mentioned below
/etc/cpanel_exim_system_filter2

  1. Scroll down and click the Save button.

  1. This will update the settings and restart the Exim server.