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 > 7.X
CAUSE
Archive requirement.
RESOLUTION
- Open and edit
/usr/local/atmail/mailserver/configure
- 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> - 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> - Save changes and exit.
- Create
/usr/local/atmail/mailserver/etc/atmail.filter
- 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 - 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 - Save changes and exit.
- Restart atmail services.
/etc/init.d/atmailserver restart
- Archiving will be now setup for the accounts specified.
- 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.
Comments