Difference between revisions of "Archiving Emails from a Qmail Based Email Server"

Jump to: navigation, search
[unchecked revision][unchecked revision]
(prepare mailarchive user)
(Step 4: Configuration of MailStore Server)
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Qmail has the ability to set up a mailbox where all emails that Qmail handles get copied to. Here is an adapted version of the appropriate "Life with Qmail FAQ" article
+
'''Please note:''' This tutorial only covers the specifics of archiving an email server based on the mail transfer agent Qmail. It is assumed that you already have a MailStore Server installation or [http://www.mailstore.com/en/lp/sendlicense.aspx test installation] and are familiar with the fundamentals of MailStore Server.Please refer to the [[MailStore_Help|Manual]] or the [[Quick Start Guide]] for more information.
  
=== Edit extra.h ===
+
MailStore Server offers several ways to archive emails from an email server, which are described below. If you are not sure which archiving method best suits your company, please refer to chapter [[Choosing the Right Archiving Strategy]].
  
QUEUE_EXTRA is a compile-time configuration variable that specifies an additional recipient that will be added to every delivery. This is used primarily for logging. E.g., the FAQ describes how to use QUEUE_EXTRA to keep copies of all incoming and outgoing messages.
+
= Synchronizing Users =
  
To use QUEUE_EXTRA, edit extra.h specifying the additional recipient in the format "Trecipient\0", and the length of the QUEUE_EXTRA string in QUEUE_EXTRALEN (the "\0" counts as one character). For example:
+
Additionally to file-based user databases, an email server based on the mail transfer agent Qmail may also use SQL databases or LDAP directory services to manage and authenticate users. As MailStore Server also supports Active Directory and other LDAP directory services (e.g. OpenLDAP), it is recommended to set up synchronization in MailStore as well. Additional information on synchronizing users can be found in the corresponding chapters of the MailStore Server manual:
  
  #define QUEUE_EXTRA "Tmailarchive\0"
+
* [[Active Directory Integration]]
  #define QUEUE_EXTRALEN 13
+
* [[Generic LDAP Integration]]
  
=== Recompile Qmail ===
+
'''Note:''' When [[Batch-archiving IMAP Mailboxes|batch-archiving IMAP mailboxes]]  MailStore Server automatically creates non-existing users. The authentication type of those users will be set to ''MailStore-integrated''.
  
Shut down qmail if it's running. If you installed the qmailctl script from the Installation section, that can be done by:
+
= Archiving Individual Mailboxes =
 +
 
 +
Mail transfer agents such as Qmail are only responsible for transporting emails and, when acting as mail delivery agent, for the delivery to local mailboxes. For  accessing the emails in the mailboxes with MailStore, an IMAP- or POP3 service (called mail retrieval agent) has to be installed and started on the email server. If access to the email server via the IMAP and/or POP3 protocol is possible, please refer to the corresponding chapter [[Archiving Server Mailboxes]] in the MailStore Server manual to set up the archiving process.
 +
 
 +
= Archiving Multiple Mailboxes in One Step =
 +
 
 +
Mail transfer agents such as Qmail are only responsible for transporting emails and, when acting as mail delivery agent, for the delivery to local mailboxes. For  accessing the emails in the mailboxes with MailStore, an IMAP- or POP3 service (called mail retrieval agent) has to be installed and started on the email server. If access to the email server via the IMAP  protocol is possible, please refer to the corresponding chapter [[Batch-archiving IMAP Mailboxes]] in the MailStore Server manual to set up the archiving process.
 +
 
 +
= Archiving Incoming and Outgoing Emails Directly =
 +
In addition to delivering the messages to their respective user mailboxes, it is recommended to have Qmail send a copy of all emails to an archiving mailbox when archiving incoming and outgoing emails directly. This requires certain changes to be made before compiling the Qmail source code. The following guide is an adapted version of the article "Life with Qmail FAQ":
 +
 
 +
== Step 1: Edit extra.h ==
 +
 
 +
<tt>QUEUE_EXTRA</tt> is a compile-time configuration variable that specifies an additional recipient that will be added to every delivery. This is used primarily for logging; the FAQ describes how to use <tt>QUEUE_EXTRA</tt> to keep copies of all incoming and outgoing messages.
 +
 
 +
To use <tt>QUEUE_EXTRA</tt>, edit extra.h specifying the additional recipient in the format <tt>Trecipient\0</tt>, and the length of the <tt>QUEUE_EXTRA</tt> string in <tt>QUEUE_EXTRALEN</tt> (the "\0" counts as one character). For example:
 +
 
 +
  #define QUEUE_EXTRA "Tmailstore\0"
 +
  #define QUEUE_EXTRALEN 11
 +
 
 +
== Step 2: Recompile Qmail ==
 +
 
 +
Shut down Qmail if it's running. If you installed the qmailctl script from the Installation section, this can be done by:
  
 
   qmailctl stop
 
   qmailctl stop
Line 18: Line 40:
 
If you don't have the qmailctl script, you should use your startup/shutdown script or send qmail-send a TERM signal.
 
If you don't have the qmailctl script, you should use your startup/shutdown script or send qmail-send a TERM signal.
  
Then rebuild qmail using:
+
Go to the source code directory of the Qmail installation and rebuild Qmail using:
  
 
   make setup check
 
   make setup check
  
=== Prepare mailarchive user ===
+
== Step 3: Prepare mailstore user ==
 +
* Set up a system user with the home directory ''/var/mailstore''.
 +
* Populate <tt>~alias/.qmail-mailstore</tt> with:
 +
*: <pre>/var/mailstore/Maildir/</pre>
 +
* Finally, restart Qmail.
 +
 
 +
== Step 4: Configuration of MailStore Server ==
 +
Configure MailStore Server to archive the newly created mailbox in regular intervals (e.g. daily at 11pm) using an archiving task of type [[Archiving IMAP and POP3 Multidrop Mailboxes]].
  
Populate ~alias/.qmail-mailarchive with:
+
After archiving, emails can and should be deleted from the mailbox automatically by MailStore Server. The MailStore archiving task can be configured accordingly.
  
  /var/mailarchive/Maildir/
+
= Weblinks =
 +
* [http://www.mailstore.com/en/support.aspx MailStore Support]
 +
* [http://www.qmail.org Qmail Homepage]
 +
* [http://www.lifewithqmail.org/ Life with Qmail]
  
Finally, restart qmail.
+
[[de:E-Mail-Archivierung von einem auf Qmail basierenden E-Mail-Server]]

Latest revision as of 09:20, 21 May 2013

Please note: This tutorial only covers the specifics of archiving an email server based on the mail transfer agent Qmail. It is assumed that you already have a MailStore Server installation or test installation and are familiar with the fundamentals of MailStore Server.Please refer to the Manual or the Quick Start Guide for more information.

MailStore Server offers several ways to archive emails from an email server, which are described below. If you are not sure which archiving method best suits your company, please refer to chapter Choosing the Right Archiving Strategy.

Synchronizing Users

Additionally to file-based user databases, an email server based on the mail transfer agent Qmail may also use SQL databases or LDAP directory services to manage and authenticate users. As MailStore Server also supports Active Directory and other LDAP directory services (e.g. OpenLDAP), it is recommended to set up synchronization in MailStore as well. Additional information on synchronizing users can be found in the corresponding chapters of the MailStore Server manual:

Note: When batch-archiving IMAP mailboxes MailStore Server automatically creates non-existing users. The authentication type of those users will be set to MailStore-integrated.

Archiving Individual Mailboxes

Mail transfer agents such as Qmail are only responsible for transporting emails and, when acting as mail delivery agent, for the delivery to local mailboxes. For accessing the emails in the mailboxes with MailStore, an IMAP- or POP3 service (called mail retrieval agent) has to be installed and started on the email server. If access to the email server via the IMAP and/or POP3 protocol is possible, please refer to the corresponding chapter Archiving Server Mailboxes in the MailStore Server manual to set up the archiving process.

Archiving Multiple Mailboxes in One Step

Mail transfer agents such as Qmail are only responsible for transporting emails and, when acting as mail delivery agent, for the delivery to local mailboxes. For accessing the emails in the mailboxes with MailStore, an IMAP- or POP3 service (called mail retrieval agent) has to be installed and started on the email server. If access to the email server via the IMAP protocol is possible, please refer to the corresponding chapter Batch-archiving IMAP Mailboxes in the MailStore Server manual to set up the archiving process.

Archiving Incoming and Outgoing Emails Directly

In addition to delivering the messages to their respective user mailboxes, it is recommended to have Qmail send a copy of all emails to an archiving mailbox when archiving incoming and outgoing emails directly. This requires certain changes to be made before compiling the Qmail source code. The following guide is an adapted version of the article "Life with Qmail FAQ":

Step 1: Edit extra.h

QUEUE_EXTRA is a compile-time configuration variable that specifies an additional recipient that will be added to every delivery. This is used primarily for logging; the FAQ describes how to use QUEUE_EXTRA to keep copies of all incoming and outgoing messages.

To use QUEUE_EXTRA, edit extra.h specifying the additional recipient in the format Trecipient\0, and the length of the QUEUE_EXTRA string in QUEUE_EXTRALEN (the "\0" counts as one character). For example:

 #define QUEUE_EXTRA "Tmailstore\0"
 #define QUEUE_EXTRALEN 11

Step 2: Recompile Qmail

Shut down Qmail if it's running. If you installed the qmailctl script from the Installation section, this can be done by:

 qmailctl stop

If you don't have the qmailctl script, you should use your startup/shutdown script or send qmail-send a TERM signal.

Go to the source code directory of the Qmail installation and rebuild Qmail using:

 make setup check

Step 3: Prepare mailstore user

  • Set up a system user with the home directory /var/mailstore.
  • Populate ~alias/.qmail-mailstore with:
    /var/mailstore/Maildir/
  • Finally, restart Qmail.

Step 4: Configuration of MailStore Server

Configure MailStore Server to archive the newly created mailbox in regular intervals (e.g. daily at 11pm) using an archiving task of type Archiving IMAP and POP3 Multidrop Mailboxes.

After archiving, emails can and should be deleted from the mailbox automatically by MailStore Server. The MailStore archiving task can be configured accordingly.

Weblinks

Navigation
Tools
Print/export
About MailStore

  • MailStore Server is one of the leading email archiving solutions for SMB.
  • For private use there is a free tool for email archiving furthermore: MailStore Home.