Postfix 2.0 and later works well with Archiveopteryx.
The easiest way to integrate the two is to use Postfix as a mail hub. Postfix accepts mail via SMTP, injects local mail into Archiveopteryx via LMTP. Archiveopteryx accepts mail submissions from clients using SMTP submission, performs authentication and other chores, and forwards the mail to Postfix.
In archiveopteryx.conf, you must make sure SMTP is disabled and LMTP is enabled (this is the default), and select a suitable address and port for LMTP.
lmtp-address = 127.0.0.1 lmtp-port = 2026
In the Postfix file main.cf, you tell Postfix to deliver local mail via LMTP to the same address and port:
mailbox_transport = lmtp:inet:127.0.0.1:2026
Postfix normally delivers only one message at a time to local recipients. When using LMTP, that's unnecessary:
local_destination_recipient_limit = $lmtp_destination_recipient_limit
If local_destination_recipient_limit is too low, messages may occasionally be delivered several times. The root cause is complex, but it's simple to avoid the problem. Set local_destination_recipient_limit to be bigger than your largest alias.
The many other LMTP-related variables in Postfix can be left untouched.
If you want to use SMTP submission, Archiveopteryx must be allowed to send mail via postfix. The simplest way is to include Archiveopteryx' IP address into the Postfix mynetworks variable.
The configuration variable smarthost-address must point to Postfix.
Postfix can check whether an address is valid while it is receiving the message via SMTP, and reject mail to invalid addresses at once. This tends to limit backscatter, so it is both polite to poor spam victims and saves bandwidth.
If all valid addresses on your system are either Postfix aliases (e.g. as defined in /etc/aliases) or Archiveopteryx addresses, then this setting will do it:
local_recipient_maps = pgsql:aox-addresses $alias_maps
$alias_maps checks whether the address is a system alias, and the file aox-addresses defines the SQL query Postfix uses to check whether an address belongs to Archiveopteryx. It should contain something like:
hosts = sqlserver dbname = archiveopteryx user = postfix password = password query = select address from aliases al join addresses a on (al.address=a.id) where lower(a.localpart)=lower('%u') and lower(a.domain)=lower('%d')
sqlserver points to PostgreSQL server, ie. it the same as db-host. archiveopteryx is the database name, ie. the same as db-name.
postfix and password represent a valid SQL user with the right to to read the aliases and addresses table. You can create such a user using psql:
create user "postfix" with encrypted password "password";
grant select on aliases, addresses to "postfix";
In case you have any questions, please write to info@oryx.com.
Last modified: 2008-09-03
Location: aox.org/postfix