help centre
For more info visit status.atmail.com

How can we help?


Search our knowledge base for answers to
common questions and latest updates.



My activities New request

Follow

Archive all mail for specific accounts via Exim

Stewart -

PROBLEM

I want to be able to archive all mail for a/some specific users via Exim.

ENVIRONMENT

  • On-Premise Server + WebMail Installations: Version 6.0 > Current Version

CAUSE

Archive requirement.

RESOLUTION

  1. Open and edit /usr/local/atmail/mailserver/configure
  2. Locate
    ######################################################################
    # @Mail SMTP Configuration File
    # Note: It is highly recommend you use the @Mail Webadmin to modify this file
    # otherwise the Webadmin script may not correctly parse the custom configuration file
    # WARNING: Do not remove the custom <CONFIG> lines used by the Webadmin
    # For further details see: http://support.atmail.com/exim.html
    ######################################################################

    #<SMTP_TLSC_ENABLE>
    daemon_smtp_ports = 25:587
    #tls_on_connect_ports = 465
    #</SMTP_TLSC_ENABLE>
  3. Change to
    ######################################################################
    # @Mail SMTP Configuration File
    # Note: It is highly recommend you use the @Mail Webadmin to modify this file
    # otherwise the Webadmin script may not correctly parse the custom configuration file
    # WARNING: Do not remove the custom <CONFIG> lines used by the Webadmin
    # For further details see: http://support.atmail.com/exim.html
    ######################################################################

    #
    #<SYSTEM FILTER FOR SINGLE USERS EMAIL ARCHIVING>
    #
    system_filter = /usr/local/atmail/mailserver/etc/atmail.filter
    system_filter_user = atmail
    system_filter_group = atmail
    #
    #</SYSTEM FILTER FOR SINGLE USERS EMAIL ARCHIVING>
    #

    #<SMTP_TLSC_ENABLE>
    daemon_smtp_ports = 25:587
    #tls_on_connect_ports = 465
    #</SMTP_TLSC_ENABLE>
  4. Save changes and exit.
  5. Create /usr/local/atmail/mailserver/etc/atmail.filter
  6. Edit /usr/local/atmail/mailserver/etc/atmail.filter and add
    # don't want to get multiple copies
    if first_delivery
    and (("$h_to:, $h_cc:" contains "user1@domain.com")
    or ("$h_from:" contains "user1@domain.com"))
    then
    unseen deliver "archive@domain.com"
    endif    
  7. Add new block for each account you want to archive.
    # don't want to get multiple copies
    if first_delivery
    and (("$h_to:, $h_cc:" contains "user1@domain.com")
    or ("$h_from:" contains "user1@domain.com"))
    then
    unseen deliver "archive@domain.com"
    endif     
             
    if first_delivery
    and (("$h_to:, $h_cc:" contains "user2@domain.com")
    or ("$h_from:" contains "user2@domain.com"))
    then
    unseen deliver "archive@domain.com"
    endif

    if first_delivery
    and (("$h_to:, $h_cc:" contains "user3@domain.com")
    or ("$h_from:" contains "user3@domain.com"))
    then
    unseen deliver "archive@domain.com"
    endif
  8. Save changes and exit.
  9. Restart atmail services.
    /etc/init.d/atmailserver restart
  10. Archiving will be now setup for the accounts specified.
  11. Note, the maildir archive directory should be backed up via cron each month and automatically pruned of messages. Otherwise the performance can decrease if the directory contains a large number of messages.

 

Have more questions? Submit a request

Comments


Contact our support team


+61 (7) 5357 6605       support@atmail.com