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
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
- Click Configuration->Listeners.
- Select Milter Listener in the drop down and then click the New Listener button.
- Check "Listen for incoming Sendmail/Postfix requests"
- Leave the Sendmail Milter port as 8092
- Click Save
Postfix Configuration
- Add the following to Postfix’s main.cf file:
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)
- Restart postfix
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:
milter_default_action = tempfail
milter_connect_timeout = 120s
milter_command_timeout = 120s
milter_content_timeout = 900s
SMTP Approach
MailArchiva has an embedded SMTP server that by default listens on port 8091.
MailArchiva Configuration
- Login to the MailArchiva web console (by default accessible from http://localhost:8090)
- Click Configuration->Listeners.
- Select SMTP Listener in the drop down and then click the New Listener button.
- Check "Listen for incoming Exchange/SMTP requests"
- Set the Exchange port to 25
- 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:
-
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. -
Restart postfix
service postfix restart
Found this information useful? Visit mailarchiva.com to learn more about MailArchiva.