Microsoft Exchange

 

When working with MS Exchange, MailArchiva requires two separate connections:

 

  1. An SMTP listener. Receives email journaling traffic from MS Exchange on port 25
  2. An Exchange client connection. Synchronizes folders, calendars and contacts from MS Exchange (this connection is not used to receive live email journaling traffic)

The basic configuration steps are as follows:

 

  1. Setup Active Directory (AD) Authentication
  2. Configure an Exchange Impersonation account
  3. Create an Exchange client connection in MailArchiva
  4. Configure MailArchiva to listen on port 25 for MS Exchange traffic
  5. Setup Exchange journaling using the SMTP protocol

        a) Exchange 2013/2016/2019

        b) Exchange 2010+

        c) Exchange 2007

        d) Exchange 2003


  1. Import historical data from MS Exchange

 

Note: If, after following the below steps, emails are still not appearing in the search results, refer to Archiving Stopped for further troubleshooting steps.

 

Note: If you are connecting On Premise Microsoft Exchange with MailArchiva Cloud (not MailArchiva On Premise), refer to MailArchiva Cloud to On Premise Exchange Setup.

 

 

MailArchiva SMTP Listener
 

Note: This step is only required for those using MailArchiva On Premise. Skip this step if using MailArchiva Cloud.

 

  1. In the MailArchiva Console, Click Configuration->Listeners.
  2. Select SMTP Listener in the drop down and then click the New Listener button.
  3. Check "Listen for incoming Exchange/SMTP requests"
  4. Set the SMTP port as 25
  5. Click Save
Test: To test whether MailArchiva's smtp server is actually listening on port 25, drop to the command prompt and telnet to port 25. 
 
Firewall: Please ensure that the firewall running on the MailArchiva box has port 25 open.
 
 

Exchange 2013/2016/2019 SMTP Journaling Setup

 
 

Setup Journaling

 

  1. Login to the Exchange Control Panel by opening the browser at https://[exchange ipaddress]/ecp
  2. From the Exchange Admin Center
  3. Click compliance management in left menu
  4. Click journal rules in top right menu
  5. Click the + icon
  6. Enter journal in the name field
  7. In the field that says "If the message is sent to or received from...", select "Apply to all messages".
  8. In the field that says "journal the following messages..", select "All messages"
  9. In Send journal reports to field, enter archive@[fully qualified domain name of your mailarchiva server]. For example: archive@mailarchiva.company.com) If archiving to MailArchiva Cloud, enter [value of journal recipient field in MailArchiva Web Console->System Status]@[fully qualified domain name of your mailarchiva server].  For example: journal-000000T0R2KQuOyRvlZ18qxiAekc6RRHkQb4i0GjkJ3t4Ns150SfrknkuLMbGAr@mailarchiva.company.com).
     
    Note: Your instinct will be to enter an email address above. This is wrong! The domain suffix must be the fully qualified domain name (FQDN) of the MailArchiva server (NOT AN EMAIL ADDRESS!)
  10. Click Save to change changes
  11. Accept "Do you want this rule to apply to all future messages"

 

Note: Ensure that the archive email address specified has a domain suffix that resolves to the MailArchiva server IP address. For example, in the above example, mailarchiva.company.com must resolve to the IP address of the MailArchiva server. 
 
 
Create a Send Connector
 
Note: This step may not be necessary if domain name of the MailArchiva server has an MX record with the IP address of the MailArchiva server.
 
  1. Select Mail Flow and then Send Connectors
  2. Click + to add a new send connector
  3. Enter 'Mailarchiva' in the Name field.
  4. Select Custom for the Type option
  5. Click Next
  6. Under Network settings, select Route mail to smart host
  7. Click + to add a new smart host
  8. Enter the fully qualified domain name of the MailArchiva server (e.g.  mailarchiva.company.com). Click Save
  9. The new host should be listed under Smart Host in the New Send Connector Window. Click Next
  10. Select None for the Smart host authentication option. Click Next. 
     
    Note: For enhanced security, consider enabling connection security and certificate authentication
  11. Click + to add a new address space. Enter the fully qualified domain name (FQDN) of the Mailarchiva Server.  Click Next.
  12. Click + to select. In the popup dialog select the source Exchange server, then click Add. Click OK.

  13. Click Finish.

Adjust Maximum Message Size

 

By default, the maximum send message size for the Connector is set to 10 MB. This is far too low for most journaling applications

 

To change this:

 

  1. Open the Exchange Management Shell
  2. Enter the following command to the set maximum send message size: Set-SendConnector "MailArchiva Connector" -MaxMessageSize "200 MB"
  3. Enter the following command to verify the maximum send message size is 200 MB: Get-SendConnector "MailArchiva Connector" |fl MaxMessageSize

Disable Non Delivery Reports (optional)

 

  1. Open the Exchange Management Shell.
  2. Enter the following command to disable NDRs
  3. Set-RemoteDomain <Domain> -NDREnabled $false (replace <Domain> with the FQDN of the MailArchiva server [e.g. mailarchiva.company.com]

 

Exchange 2010 SMTP Journaling Setup

 

Create Mail Contact
 

  1. Click Start > All Programs > Microsoft Exchange Server 2010 > Exchange Management Console
  2. Select the Microsoft Exchange On-Premises instance
  3. Select Recipient Configuration
  4. Below the Recipient Configuration, select Mail Contact
  5. In the  Action pane to the right,  select New Mail Contact
  6. In the create mail contact dialog that appears, select New Contact
  7. Enter "journal" for the new contact name and fill out the rest of the required information.
  8. Select Edit aside the new contact's external e-mail address
  9. A dialog appears prompting for an external email address.  Enter the equivalent of "archive@mailarchiva.company.com"
  1. After entering the address, click OK.   After returning back to the new contact dialog, select Next
  2. Select new to create the New Mail Contact
  3. After clicking New,  the New Mail Contact will be created.  
  4. Click Finish to return to the Exchange Management Console.
Note: Ensure that the archive email address specified has a domain suffix that resolves to the MailArchiva server IP address. For example, in the above example, mailarchiva.company.com must resolve to the IP address of the MailArchiva server. 

Enable Standard Journaling

  1. Click Organization Configuration, thereafter Mailbox
  2. In the Database Management tab to the right, select  the database for which journaling must be enabled.
  3. Right click on the database and select properties
  4. A new window appears.  Select the maintenance tab and then select Browse
  5. Click the Journal Recipient and then browse to the New Mail Contact created previously
  6. Click OK

Create a Send Connector

 

Note: This step may not be necessary if domain name of the MailArchiva server has an MX record with the IP address of the MailArchiva server.

 

  1. Open the Send Connector tab under Server Management->Hub Transport option
  2. Right-click in the empty space and select new Send Connector
  3. Ensure intended use field is set to custom.
  4. Enter the MailArchiva in Name field, then click “Next."
  5. Click “Add” in the address space window
  6. In the address field, enter the fully qualified domain name of the MailArchiva server (e.g. mailarchiva.company.com)
  7. Select "Route mail through the following smart hosts". Click Add..
  8. Select IP Address. Enter the IP address of the MailArchiva server. Click OK, then Next.

  9. Leave smart host authentication settings as None. Click Next.

  10. Choose the Hub Transport Server's that apply. Click Next.

  11. Preview Configuration Summary. Click New.

 

Exchange 2007 SMTP Journaling Setup

 

Create Mail Contact
 
  1. Start the Microsoft Exchange Console
  2. Expand Recipient Configuration, then select Mail Contact.
  3. Open Mail Contact item

  4. In right actions pane, click New Mail Contact

  5. In Name field, Enter mailarchiva 

  6. In Email Address Field, enter [value of journal recipient field in MailArchiva Web Console->System Status]@[fully qualified domain name of your mailarchiva server]. For example: journal-000000T0R2KQuOyRvlZ18qxiAekc6RRHkQb4i0GjkJ3t4Ns150SfrknkuLMbGAr@mailarchiva.company.com)

     
    Note: Your instinct will be to enter an email address above. This is wrong! The domain suffix must be the fully qualified domain name (FQDN) of the MailArchiva server (NOT AN EMAIL ADDRESS!)
  7. Click Ok
Note: Ensure that the archive email address specified has a domain suffix that resolves to the MailArchiva server IP address. For example, in the above example, mailarchiva.company.com must resolve to the IP address of the MailArchiva server. 

 

Configure Message Format Settings
 

  1. Open your Exchange Management Console.
  2. Expand Recipient Configuration, then select Mail Contact.
  3. In the result pane, select the Mail contact.
  4. In the action pane, under the Mail contact, click Properties.
  5. On the General tab, from the Use MAPI rich text format list, select Never.

With this setting, journal reports are sent in MIME rather than S/TNEF.

 

Create Send Connector

 

Note: This step may not be necessary if domain name of the MailArchiva server has an MX record with the IP address of the MailArchiva server.

 

  1. Open the Exchange Management Console
  2. Expand Organization->Hub Transport
  3. Select Send Connector tab
  4. In Actions page, click New Send Connector

  5. In Name field, enter MailArchiva. Click New

  6. Click Add in Address Space

  7. Enter fully qualified domain name (FQDN) of MailArchiva server (e.g. mailarchiva.company.com)

  8. Leave "include all subdomains" unchecked. Click OK, then Next

  9. Select "Route mail through the following smart hosts". Click Add..

  10. Select IP Address radio button. Enter the IP address of the MailArchiva server. Click OK, then Next

  11. Leave smart host authentication settings as None. Click Next

  12. Choose the hub transport servers that apply (as necessary). Click Next

  13. Preview Configuration Summary. Click New.

Enable Standard Journaling

 

  1. Open the Exchange Management Console
  2. Expand Organization->Hub Transport
  3. Click New Journal Rule
  4. Enter "mailarchiva" for the Rule Name

  5. Next to "send journal reports to email address:", click Browse and select "mailarchiva" Mail Contact created earlier

  6. Ensure Scope is set to Global

  7. Check Enable Rule

  8. Click New

If no emails arrive, please follow the Archiving Stopped troubleshooting steps.

 

Exchange 2003 SMTP Journaling Setup

 

Create Mail Contact

 

  1. Open the Active Directory Users and Computers by selecting Start > All Programs > Administrative Tools.
  2. Right click Users and select New, then select Contact
  3. In the New Object - Contact window, type "MailArchiva" in the First name field, "Archive" in the Last name field. Click Next.
  4. Select Create an Exchange email address checkbox. Click Modify.
  5. Select SMTP Address in the New E-mail Address window and then click OK. 
  6. In the E-mail address field on the General tab of the Internet Address Properties window, enter the equivalent of mailarchiva@[FQDN of MailArchiva server]) (for example, mailarchiva@mailarchiva.company.com)
  7. In the Internet Address Properties window, click the Advanced tab
  8. Check the box for Override Internet Mail settings for this recipient.
  9. Under Message Format: check the radio button for MIME.
  10. Under Message Body: check the radio button for Plain Text, and then click OK.
  11. The Internet Address Properties window closes. Click Next.
  12. Click Finish.

 

Create SMTP Connector

 

Note: This step may not be necessary if domain name of the MailArchiva server has an MX record with the IP address of the MailArchiva server.

 

  1. Open the Exchange System Manager window by selecting Start -> Programs -> Microsoft Exchange -> System Manager.
  2. In the left-hand menu, right-click Connectors.
  3. Select New and then select SMTP Connector.
  4. In the Properties window, type "MailArchiva Archive" in the Name field.
  5. Select Forward all mail through this connector to the following smart hosts. Type the IP Address of the MailArchiva server into the resultant field.
  6. Within the Local Bridgeheads section, click Add. The Add Bridgehead dialog box displays. Select the server in which you would like to name the bridgehead. Click OK to close the dialog box.
  7. In the Properties window, click the Address Space tab. Click Add.
  8. Select SMTP in the resulting Add Address Space dialog box. Click OK.
  9. In the Email Domain field of the Internet Address Space Properties dialog, enter fully qualified domain name (FQDN) of MailArchiva server (e.g. mailarchiva.company.com). Type 1 in the Cost field. Click OK to close the dialog box.
  10. The FQDN of the MailArchiva server is displayed in the Properties window. Only this item should be selected in the Address Space field.
  11. In the Properties window, click the Advanced tab. Click Outbound Security
  12. Make sure TLS encryption checkbox is unchecked, in the resulting Outbound Security dialog box. Click OK to close the dialog box.
  13. Click OK to close the Properties window.

 

Activate Journaling

 

  1. Open the Exchange System Manager window by selecting Start -> Programs -> Microsoft Exchange ->System Manager
  2. In the left navigation menu, select Servers, select your server name. Thereafter, select the Storage Group that contains the mailboxes to which journaling should be applied.
  3. In the right-hand content frame, right-click the Mailbox Store you wish to apply journaling, from within the list. Select Properties in the drop-down menu.
  4. In the Mailbox Store Properties window, select the Archive all messages sent or received by mailboxes on this store checkbox
  5. In Select Recipient dialog box, type the name of the Journaling Mail Contact created earlier. Click OK.
  6. The Journaling Mail Contact appears within the Mailbox Store Properties window. Click OK to close the window
 
Disable Non Delivery Reports (NDRs) For MailArchiva
 
  1. Open the Exchange System Manager window by selecting Start -> Programs - > Microsoft Exchange -> System Manager
  2. Expand the Global Settings folder in the left navigation menu. Right-click Internet Message Formats. Select New and then select Domain.
  3. In the General tab of the Properties window, enter the fully qualified domain name of the MailArchiva server (e.g. mailarchiva.company.com)
  4. In the Message Format tab of the Properties window, select the MIME and "Provide message body as plain text" radio buttons.
  5. In the Advanced tab of the Properties window, select "Never use" within the Exchange rich-text format section.
  6. Deselect the Allow non-delivery reports checkbox
     
Note: After enabling journaling, for journaling to become activated, it may be necessary to restart the Hub Transport Service on the Exchange Server.

 

IMAP Journaling

 

The IMAP Journaling approach involves retrieve journal traffic from MS Exchange using the IMAP protocol. This requires two steps:

 

  1. Configure MS Exchange - Create a journal mailbox and configure MS Exchange to send journaling traffic to it

        a) Exchange 2007/2010+

        b) Exchange 2003
 

  1. Configure MailArchiva - Create an IMAP connection in MailArchiva for the purposes of retrieving emails from MS Exchange

 

If running MS Exchange in a Clustered Environment, refer to Additional Cluster Environment Steps.

 

Exchange 2007 / 2010 IMAP Journaling Configuration

 

  1.  Create a Journal Account

On the server running Microsoft Exchange, open the Active Directory Users and Computers console, right-click on the Users container and choose New -> Contact from the menus. When prompted, enter the first name, last name, full name and display name of the contact you're creating and click OK.
 

  1. Enable Journaling Agent

Go to the Hub Transport server, open the Exchange Management Shell, and execute the following command:
 

 
Get-TransportAgent
 

 
The Get-TransportAgent command will return a status of either True or False, indicating whether or not the journaling agent is enabled.
 


 
If the journaling agent's enabled status is False, then you will have to enable the journaling agent before continuing. To do so, enter the following command:
 

 
Enable-transportagent
 

 
The command prompts you to enter additional information.
 

 
To enable the journaling agent, enter the words "Journaling Agent."

 

The Exchange Management Shell doesn't provide any confirmation that the journaling agent has been enabled. Enter the Get-TransportAgent command once again to confirm that the journaling agent has been activated.
 

  1. Create a Journaling Rule

The process of creating an Exchange 2007/2010 journaling rule is fairly simple:
 
   a) Open the Exchange Management Console and navigate through the console tree to Organization Configuration -> Hub Transport.
 
   b) Select the Journaling tab, and then click the New Journal Rule link found in the Actions pane to open the New Journal Rule wizard. Enter a descriptive name for the Exchange 2007 journaling rule that you are creating.

 
 
  c) Just beneath the Rule Name field is the Send Journal Reports to E-Mail Addresses field. This is where you supply the name of the journal mailbox.
 
  d) In the scope field, select all messages.
 
  e) In the next field, specify the journal mailbox as the recipient.
 
  f) Finally, the wizard contains a checkbox that you can use to enable the rule upon creation. This is checked by default, unless you choose to deselect it prior to creating the journaling rule.
 
  g) After filling in the wizard's various parameters, click the New button and the Exchange 2007 journaling rule will be created.
 

  1.  Configure Exchange IMAP Server Settings

 
Configure the Microsoft Exchange IMAP server to accept plaintext authentication. In Exchange 2007, the IMAP server settings are accessible from the Exchange Management Console in Server Configuration > Client Access > IMAP4 > Properties -> Authenticaton tab. 
 
MailArchiva expects the journal envelopes it receives to be in plaintext. Care should be taken to ensure that Microsoft Exchange’s IMAP server will not convert the journal messages to TNEF, rich text or HTML. In Exchange 2007, this option is accesible from the Exchange Management Console in Server Configuration -> Client Access -> IMAP4 -> Properties -> Retrieval Settings tab. Select the Message MIME format to “Best Body Format”.
 

  1. Start the Exchange IMAP Service in Windows Services.

Click Start, type "services.msc" in the search box. Locate the IMAP service and start.

Exchange journaling configuration is complete. Proceed to Create Journal Connection in MailArchiva.

 

Microsoft Exchange 2003 IMAP Journaling Configuration 

 

  1. On the server running Microsoft Exchange, using the Active Directory Users and Computers browser, create a Windows user account where all incoming and outgoing mail will be temporarily archived. This account must reside on your company’s domain (i.e. not a local machine account).


     
  2. On the same server, run the System Manager Application included with Microsoft Exchange. Locate the Mailbox Store node in the tree view on the left. It is in Servers->First Storage Group->Mailbox Database. Right click the Mailbox Database object and click Properties. A dialog will appear as in Figure 2. Click Browse and enter “journal” for the object name. Click OK. Journaling is now enabled for the Mailbox Store.

  3. If you are using Exchange 2000/2003
    i) Install the latest Service Pack ii) Download the Exejcfg.exe utility from Microsoft’s Download Center
    To enable envelope journaling, from command prompt, type:
    Exejcfg e

 

 

  1. Configure the Microsoft Exchange IMAP Server Settings

    Ensure that the Microsoft Exchange IMAP server is configured to accept plaintext authentication. In addition, MailArchiva expects the journal envelopes it receives to be in plaintext. Care should be taken to ensure that Microsoft Exchange’s IMAP server will not convert the journal messages to TNEF, rich text or HTML.
     

  2. Start the Exchange IMAP Service in Windows Services.

    Click Start, type "services.msc" in the search box. Locate the IMAP service and start.

    Exchange journaling configuration is complete. Proceed to Create Journal Connection in MailArchiva.

 

MailArchiva Configuration - Create Journal Connection


MailArchiva must be configured to retrieve emails from the Exchange journal account created earlier.

IMAP Connections Details

Enable Journalling in MailArchiva:
 

  1. In Configuration->Connections, select IMAP Client and click New Connection
  2. Enter the server address of your Exchange server
  3. Enter the Microsoft Exchange journal account username and password

 

Warning: Do not enter a normal user account. Enter only the username of the journal account. MailArchiva will automatically delete emails from this account once the emails are processed
 
  1. For the connection Mode, select TLS when available (on some versions of MS Exchange you will need to select SSL)
  2. Ensure Auth Certs is unchecked.
  3. Disable IMAP Idle (some Exchange Server seem to stop delivering emails after a period when IMAP Idle is enabled)
  4. Click Save to save configuration.
  5. Click Test Connection to ensure that MailArchiva is able to establish a clean connection to Exchange's IMAP Server.
  6. If the test is successful, check the Enabled checkbox and Save the configuration.
  7. Click Status at the top menu. A chart should be displayed. When emails arrive, they will appear as moving bars in the chart.
  8. Verify that MailArchiva is receiving journal envelopes
    Select Configuration->Search tab->Export Method->journal Message. Thereafter, in Search, export a message and view a text editor. The message should contain a journal envelope. There should be no HTML or special character codes in the journal envelope. If there are special characters, then TNEF or HTML conversion is not disabled as it should be.

 

Exchange 2013 Workaround:  There have been reports that journaling stops with the following error outputted in the debug.log file: failed to retrieve messages during polling operation:message number (35246) out of bounds (35245). To workaround this issue, please disable Partial Fetches in the IMAP client configuration.

 

If no emails arrive, please follow the Archiving Stopped troubleshooting steps.

 

Additional Steps for a Clustered Environment

 

If Exchange operates in a clustered environment, the IMAP resource will need to be added to the cluster.
 

  1. Open the ‘Cluster Admin’ console
  2. Click on the Exchange Resource Group
  3. Click File -> New -> Resource in the Menu.
  4. Enter a friendly name for the IMAP4 server
  5. Select "Microsoft Exchange IMAP4 Server" In the ‘Resource Type’ field
  6. Ensure that the Exchange Resource is in the ‘Resource Group’ field.
  7. Add the Nodes which you like to own the Resource, Click Next.
  8. Add the Exchange System Attendant dependency to the Resource. Click Next.
  9. Select the IMAP4 Instance as the Resource. Make the resource online.
  10. Configure MailArchiva to retrieve e-mails as above using the MS Exchange IP, not the cluster IP.

 

 

 
 
 
© 2005 - 2024 ProProfs

Found this information useful? Visit mailarchiva.com to learn more about MailArchiva.

-