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 - Forward to MailArchiva's embedded SMTP using Postfix transport maps 

IMAP - (Always BCC) Configure Postfix to send copies of all mails to a journal mailbox. Configure MailArchiva's IMAP client to retrieve from the journal mailbox

 

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. 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 Exchange port to 25
  5. Click Save

Postfix Configuration

 
Edit /etc/postfix/main.cf. Add the equvalent of the folllowing:
 
relay_domains = company.com
transport_maps = hash:/etc/postfix/transport
 
Replace Note: Don't forget to replace company.com above with your domain.
 
If there are transport_maps already present, it is posslble to specify additional transport maps (comma's separated) as follows:
 
relay_domains = company.com
transport_maps = hash:/etc/postfix/anothertransport, hash:/etc/postfix/transport
 
Save the main.cf file. 
 
Create the file /etc/postfix/transport. Add the equivalent of:
 
company.com smtp: [mailarchiva.company.com]
 
Where ...
 
1) company.com is your company domain (please replace above)
2) mailarchiva.company.com is the FQDN of the MailArchiva server on your network (please replace above)
 
Run the following commands
 
$ postmap /etc/postfix/transport
$ /etc/init.d/postfix reload

 

tail -f /var/log/mail.log


Always BCC Approach

 

This approach involves configuring Postfix to send copies of all emails to a specific journal mailbox and then configuring MailArchiva to retrieve emails from the mailbox using IMAP.

 

MailArchiva Configuration

 

  1. Click Configuration->Listeners.
  2. Select SMTP Listener in the drop down and then click the New Listener button.
  3. Check "Listen for incoming SMTP/Exchange requests"
  4. Leave the SMTP port as 8091
  5. Click Save

 

Postfix Configuration
 

To accomplish this:
 

  1. Create a new mailbox called "journal" and set a password (on Unix, you would typically use the useradd command to create a new user)
  2. Add the following line to Postfix's main.cf:

    always_bcc = journal@domain.com (replace journal@domain with your domain)
     

  3. In MailArchiva, select Connections -> IMAP Client -> New Connection. Add a new IMAP journal account connection to the IMAP service running on the Postfix server.
  4. Optionally: enable IMAP Idle to receive message arrival notification as opposed to polling (if you later find archiving stops after a period, you will need to disable IMAP Idle again)
     
Was this information helpful?

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

The page cannot be found

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. Please make sure you spelled the page name correctly or use the search box.