Postfix

 

There are three ways to integrate with Postfix


Milter - Forward to MailArchiva's embedded milter server (see http://www.postfix.org/MILTER_README.html for description of Postfix's Milter capabilities)
SMTP - (Always BCC) Configure Postfix to send copies of all mails to MailArchiva directly via SMTP
 

Note: MailArchiva's SMTP server is currently the most efficient method both in terms of performance and memory usage. Choose the approach that works for you!

 

Milter Approach

 

MailArchiva has an embedded Milter server that by default listens on port 8092. The instructions below configure Postfix to forward milter traffic to MailArchiva's milter server. The use of the milter protocol is not ideal, since it if the archive server goes down, delivery will be affected. Generally, the use of the SMTP protocol for archiving purposes is preferred.

 

Make sure you are using Postfix 2.4.6 or greater. 

 

MailArchiva Configuration

 

  1. Click Configuration->Listeners.
  2. Select Milter Listener in the drop down and then click the New Listener button.
  3. Check "Listen for incoming Sendmail/Postfix requests"
  4. Leave the Sendmail Milter port as 8092
  5. Click Save
Test Note: To test whether MailArchiva's milter server is actually listening on port 8092, drop to the command prompt and telnet to port 8092. 

 

Postfix Configuration

 

Postfix Bug: Earlier versions of Postfix contain a buggy milter client, causing zeroed body messages to be archived. Currently, Postfix v2.3.4 and earlier is known not to work well with the MailArchiva milter capability due to a bug in Postfix. In this case, you may need to take the BCC SMTP approach (see Zimbra integration).

 

  1. Add the following to Postfix’s main.cf file:
milter_default_action = tempfail
smtpd_milters = inet:127.0.0.1:8092

(if MailArchiva is running on a remote server, replace 127.0.0.1 with the ip address of the server where MailArchiva is running)

 

  1. Restart postfix
sudo /etc/init.d/postfix restart


Milter Default Action Options
 

  • milter_default_action = tempfail: mail is not archived when MailArchiva becomes unavailable.  Mail is not delivered to the recipient(s).  The remote client retries until the MILTER becomes available or until the mail is too old.
  • milter_default_action = accept: mail is not archived when MailArchiva is unavailable.  Mail is delivered to the recipient(s).
  • milter_default_action = quarantine: mail is not archived when MailArchiva is unavailable.  Mail is stored in the "hold" queue.

Spam Filtering


Note: If you want Spamassasin to filter out the SPAM before it hits MailArchiva, configure Spamassassin as a milter (Google the topic for info on how to do this)

Then, specify your milter configuraiton as follows:
 

smtpd_milters = unix:/var/run/spamass.sock inet:127.0.0.1:8092

milter_default_action = tempfail
milter_connect_timeout = 120s
milter_command_timeout  = 120s
milter_content_timeout = 900s

 

Postfix Hold Queue Note In Postfix 2.6, milter_default_action can be set to hold, meaning if the archive server goes down, the messages will be placed indefinitely in a hold queue. Once the archiving service is restored, the administrator can intervene and process the messages in the hold queue.

 

Reverse DNS Lookup! MailArchiva's embedded milter listener performs a reverse DNS lookup to the mail server on each connection. If MailArchiva has trouble performing a DNS lookup, then there will be a delay of 1-3 seconds imposed on each connection. To prevent this from happening, ensure that reverse DNS entries are setup correctly for both the MailArchiva server and mail server.

 

SMTP Approach

 

MailArchiva has an embedded SMTP server that by default listens on port 8091. 

 

MailArchiva Configuration

 

  1. Login to the MailArchiva web console (by default accessible from http://localhost:8090)
  2. Click Configuration->Listeners.
  3. Select SMTP Listener in the drop down and then click the New Listener button.
  4. Check "Listen for incoming Exchange/SMTP requests"
  5. Set the Exchange port to 25
  6. Click Save
     

After performing the above steps, verify there is an open line of communications by telnetting to the MailArchiva server on port 25 from the mail server. If the MailArchiva SMTP signature header is not returned, ensure that a firewall is not blocking the communications and that there is no other application binding to port 25 on the MailArchiva server.

 

Postfix Configuration

 

This approach involves configuring Postfix to send copies of all emails to MailArchiva directly via SMTP.

To accomplish this:
 

  1. Add the following line to Postfix's main.cf:

    always_bcc =  [value of journal recipient field in MailArchiva Web Console->System Status]@[fully qualified domain name of your mailarchiva server].

    For example: always_bcc = journal-000000T0R2KQuOyRvlZ18qxiAekc6RRHkQb4i0GjkJ3t4Ns150SfrknkuLMbGAr@mailarchiva.company.com) 
    (replace mailarchiva.company.com with the fully qualified domain name (FQDN) of your MailArchiva server. Ensure the FQDN is resolvable from the mail server.

  2. Restart postfix

    service postfix restart


 

© 2005 - 2024 ProProfs

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

-