ArticlesArticles Most Popular ArticlesMost Popular Articles
RSS Feeds
DrillDown Icon Table of Contents
DrillDown Icon 2020 Official Holidays & Support Schedule
DrillDown Icon IMPORTANT: End of Life of SHA1 on Windows Server 2003
DrillDown Icon IMPORTANT: Supported Operating Systems
DrillDown Icon PLEASE READ: Our Update Server IPs Have Changed
DrillDown Icon Support
DrillDown Icon modusGate for Microsoft Azure
DrillDown Icon modusCloud
DrillDown Icon Alleviating Spam – Best Practices
DrillDown Icon directQuarantine Technical Information
DrillDown Icon modusMail & modusGate Technical Information
DrillDown Icon Documentation & Release Information
DrillDown Icon Known Issues (non-release related)
DrillDown Icon Configuration Information
DrillDown Icon modusGate & modusMail
DrillDown Icon How-To: Configure TLS for POP, IMAP, SMTP
DrillDown Icon How-To: Install modus Web Components on a Separate Server
DrillDown Icon Info: Configuring modus with a Proxy Server
DrillDown Icon Info: BATV Default Subject Tags
DrillDown Icon How-To: Force Spam Updates
DrillDown Icon How-to: Repair databases that are missing objects such as indexes or constraints
DrillDown Icon How-to: Log Modus Logs to a *nix Host
DrillDown Icon How-To: Bypass Attachment Filtering TO: Certain Users or FROM: Certain Users
DrillDown Icon Info: What is an .ASY File Extension
DrillDown Icon How-To: Reduce Image Spam by Using Dynamic IP Blocklists
DrillDown Icon How-To: Enable Persist Sorting Order
DrillDown Icon Info: Fingerprinting Explained
DrillDown Icon Info: RBL Check After AUTH LOGIN
DrillDown Icon How-To: Configure ODBC for a 64-bit environment
DrillDown Icon Info: Quarantine Clean-up Process in Modus
DrillDown Icon How-To: Completely Uninstall Your Modus Product
DrillDown Icon Info: SNMP OIDs Used by Modus
DrillDown Icon Info: Testing SMTP Connections
DrillDown Icon Info: Upgrading From a Previous Version to Modus 5.x
DrillDown Icon How-To: Allow Users to Disable Quarantine Reports
DrillDown Icon How-To: Archive Messages in Modus
DrillDown Icon How-To: Attach Original Messages to Forbidden Attachment Notices
DrillDown Icon How-To: Change the Banner Greeting
DrillDown Icon How-To: Change the SMTP Parameters for the Customer Support Feature
DrillDown Icon How-To: Configure the Quarantine Database in PostgreSQL
DrillDown Icon How-To: Configure the Mailbox Directory on a Share
DrillDown Icon How-To: Delete Viruses and Forbidden Attachments from Quarantine
DrillDown Icon How-To: Disable Outbound Filtering for Specific Users
DrillDown Icon How-To: Disable Scanning for Trusted Sources
DrillDown Icon How-To: Effectively Set-up the Spam and Virus Performance Tabs
DrillDown Icon How-To: Enable Attachment Release from the Quarantine Reports
DrillDown Icon How-To: Improve the Speed of an Extended Database for Authentication
DrillDown Icon How-To: Increase the Maximum Number of Headers / Hops
DrillDown Icon How-To: Manually Compact the Quarantine Database in Access
DrillDown Icon How-To: Move ModusMail or ModusGate from One Machine to Another
DrillDown Icon How-To: Properly Test the Modus Scan Engine
DrillDown Icon How-To: Run Both MS and Modus SMTP Services
DrillDown Icon How-To: Configure the Modus Remote Console
DrillDown Icon How-To: Specify an SMTPDS IP Address
DrillDown Icon How-To: Switch Mailboxes from Registry to the Extended DB
DrillDown Icon How-To: Turn Off Corrupt Attachment Scanning
DrillDown Icon Announcement: ORDB has Shut Down
DrillDown Icon How-To: Upgrade modusMail & modusGate
DrillDown Icon Info: SCAV2 requires specific port to be opened
DrillDown Icon Sonicwall blocking Avira updates
DrillDown Icon Info: Help Improve modusGate
DrillDown Icon modusGate Only
DrillDown Icon modusMail Only
DrillDown Icon SQL Server Information
DrillDown Icon MySQL Information
DrillDown Icon Security
DrillDown Icon Sieve
DrillDown Icon Spam and False-Positives
DrillDown Icon Statistics and Monitoring Section
DrillDown Icon Web Components
DrillDown Icon Troubleshooting
DrillDown Icon Hardware & OS System Requirements
DrillDown Icon Tools
DrillDown Icon Other Product Technical Information
DrillDown Icon Professional Services
DrillDown Icon Newsletters
  Email This ArticlePrint PreviewPrint Current Article/Category and All Sub-Articles/Categories
How-To: Archive Messages in Modus


Product: All

Version & Build: All




  1. Archive storage: where to copy messages to - disk folders or Email accounts?
  2. Archiving methods: Sieve script or program agent?
  3. Selection guide: which method for my specific mail archiving purpose?


Important Notice


Email management must comply with local legal regulations about privacy protection.


Always respect local laws!




Guidelines on Workplace E-mail, Web Browsing and Privacy:


European Union

Directive 2002/58/EC of the European Parliament and of the Council of 12 July 2002:



Monitoring Employee Email:

Employee Monitoring:

Workplace Privacy:


Archive Storage Methods


1) Archiving messages to disk folders:

  • Saves messages in simple text format
  • Creates a single file per message (.MSG file extension)


  • Copying messages to backup folders cannot be detected by mail users
  • Straightforward and universal text file format (raw emails)


  • The Administrator must ensure that archived messages do not exceed the allocated storage capacity, back up archive folders and transfer data to the person in charge of monitoring and/or archiving
  • The NTFS file system has a limitation of approximately 60,000 files per folder, causing severe slow-downs when nearing this limit
  • Mail storage is located on the mail server's LAN so the monitoring manager may not have direct access to email data
  • A simple text search engine is used to locate messages. Coding, such as HTML & MIME and embedded attachments, can make the search process tedious
  • Transferring many backed-up messages at once can temporarily overload communication lines


2) Archiving messages to Email accounts:

An old computer with enough storage capacity can be configured with mail client software to regularly collect messages from archived email accounts.



  • Copying messages to archived email accounts cannot be detected by mail users
  • The process reduces the load on the server administrator
  • The monitoring manager handling archived accounts has direct access to mail traffic Simple mail collection updates all latest messages
  • Most mail client programs feature utilities to quickly search and find messages by specific properties
  • Recurrent timely message collection by the mail client prevents both overloading communication lines with large batch transfers and excessive use of storage on the mail server


  • The monitoring manager must back up the mail archive computer on a timely basis. This is not the task of the mail server administrator.


Archiving Methods


1) Sieve Script




  • The message copying occurs:
    • Before all scanning
      • Archiving all messages, including viruses, forbidden attachments, phishing and spam
    • Before spam scanning
      • Only advanced spam messages get archived with valid messages. Viruses and forbidden attachments are excluded. This process archives the actual mailboxes, plus a bit more for security
    • After all scanning
      • Sieve scripting is not active on messages scanned for spam!
    • Check when Sieve scripts come into action in the filtering sequence listed in the Vircom knowledge base article: Info: Scanning Sequence Order 
  • The mailbox or folder directory must already exist on your system
  • If users or domains are configured as trusted (see: How-To: Disable Scanning for Trusted Sources) then Sieve scripting is not active for outbound emails




Sample archiving Sieve script that copies all INcoming emails to a domain ( into an archive/monitoring mailbox (


if envelope :contains "to" ""

{ redirect ""; keep; }



The following script captures all OUTgoing emails:


if envelope :contains "from" ""

{ redirect ""; keep; }



The same method can be used to archive a single mailbox to a disk folder:


if envelope :contains "to" ""

{ fileinto "C:\\Archive_John1"; keep; }


* Keep will continue normal scanning in order to deliver to the original recipient as well



2) Agent



  • An agent calls on an external program (such as a batch file) that runs every time the server or mailbox receives a message
  • The message copying occurs immediately after reception, before virus, before forbidden attachment and before spam filters (please see Info: Scanning Sequence Order)
    • All messages get archived, including viruses, forbidden attachments, phishing and spam


System Agent


  • In the Modus Console, go to System – Properties – Agent
    • Type the name of the batch file or program to be run, followed by %m %r
      • The %m directive copies the message file
      • The %r directive copies the header envelope
      • E.g. "C:\Progra~1\Vircom\modusMail\ARCHIVEMAIL.BAT" %m %r 
    • Be sure to enter the full path to the file name with quote marks (“”)
    • Click on Apply
  • In Notepad, create a batch file using the name used in the above step and save it to a folder in the system path
    • e.g., the default Modus folder …\Vircom\Modus<Mail or Gate>
    • To archive all inbound and outbound messages of a domain (e.g., enter the following commands in the newly created batch file:



FIND /I "" %2 > nul

IF %errorlevel% == 0 COPY %1 C:\AnyDestinationFolder\


o        ModusGate only supports the ability to direct messages to a specified folder, not a mailbox

o        As ModusMail stores mailboxes locally, a ModusMail agent can archive straight to a mailbox:



FIND /I "" %2 > nul

IF %errorlevel% == 0 COPY %1 C:\Progra~1\Vircom\modusMail\MAILBOX\backup_account\INBOX\


For further details about mail agents, please see: How-To: Write a Mail Agent and Modus Mail Agent not working



Archiving Method Selection Guide (ModusGate & ModusMail)


Archiving Method

To Disk Folder

To Mailbox

Inbound only

Sieve or Mailbox Agent

Sieve, Mailbox Agent or Forward to2

Outbound only



Inbound & Outbound

Sieve1 or System Agent

Sieve1 or System Agent2


  • System Agent: archives all emails, including viruses and forbidden attachments
  • Mailbox Agent: archives only clean inbound emails that have passed through the scanner

1 Only possible for mailboxes/domains not configured as ‘trusted’

2 ModusMail only. ModusGate does not support forwarding or using an agent to archive to a mailbox



Modified 12/19/2006
Keywords: archive, copy messages
Article ID: 1561