1. Home
  2. Knowledge Base
  3. Settings
  4. Global Settings g_archive

Global Settings g_archive

g_archive - Archive delivered mail

Archive rules allowing all mail delivered to be archived to either:

Fixed size rotating archive - use this if you want to be able to get back a particular message that has recently passed thorugh the server but you do not want the mail archives to be able to grow too large

History archive of a fixed (or unlimited) duration that can grow as much as the disk space available. Use this if you need to archive say all mail sent to / from a particular customer for the last year.

The archive is stored as a directory containing bucket files. This allows you to retrieve messages that have been delivered if you need to retrieve a particular message for any reason. To retrieve a message this needs to be extracted manually from the archive files manually using a text editor or your own script. The maximum bucket size (default if 1Mb) of the archive and the maximum individual message size can be set.

Filtering is done based upon wildcard destination and source addresses and subject. These fields provide a logical AND, with a blanks filed matching the default "*". A specific email may match multiple archive rules, and will be archived in each archive in this case. Also note that if a match is part of a larger string the match string should have wildcards surrounding it. eg: to match "important business" in the subject "Very important business for you" you should specify "*important business*".

eg. To catch all email delivered from domain.com you would specify:
g_archive to="*" from="*@domain.com" subject="" path="c:\mailarchive" size="10mb" maxitem="10k" 

You can also select whether the archiving rule is triggered before or after any filtering that is applied such as virus or spam filtering using the early flag. This can be useful to capture the original source of viruses or spam for testing purposes.

Syntax: g_archive to=string from=string path=string subject=string size=string maxitem=string keep=string early=bool owner=string fromorto=string

g_archive_bucketsize - Size for archive bucket files. Default is 1mb

Sets the size of the archive buckets used by the circular archives. If set too large then editing the buckets manually is awkward.

Syntax: g_archive_bucketsize int

g_archive_early - Apply all archive rules before content filtering is applied (obsolete)

This will apply the archive rules before content filtering is applied. This can be user to capture the source message if it is getting stored or bounced unnecessarily by any of the SurgeMail filters. The early flag on individual archive rules should be used instead of this setting.

Syntax: g_archive_early bool

g_archive_files - Archive attachments to a directory

Each message to the named account will have it's attachments removed and placed in the named directory. The path can contain the symbols $month$ $year$ $day$ $second$. The 'second' is only within this day. Together these variables can be used to ensure a unique path is used for each file if the names might conflict. Use g_redirect_cc to archive email going to an existing account because if you set 'to' equal to a real account then the real account will stop receiving messages!

Syntax: g_archive_files path=string to=string files=string

g_archive_on_delete - Don't delete user files, archive them to g_archive_on_delete_dir

When deleting a user, archive the users files in the g_archive_on_delete_dir archive directory. This is now ALWAYS enabled, the setting is ignored after version 7.3p-65. Purged monthly or by tellmail purge_deleted_users

Syntax: g_archive_on_delete bool

g_archive_on_delete_dir - Directory to archive user files to on delete

Directory to archive deleted users files to. Defaults to 'archive_deleted' in the SurgeMail installation folder.

Syntax: g_archive_on_delete_dir string

g_archive_tcpip - Rules for TCPIP archive process

Contact netwin for more details of this mechanism if you wish to use it.

Syntax: g_archive_tcpip to=string from=string path=string dom=string

g_archive_tcpip_host - Host to send archive data too

When using an archive server this defines the host that is running the archive server. Contact netwin if you need more info on this feature.

Syntax: g_archive_tcpip_host string

Was this article helpful?

Related Articles