First, install Postfix as normal for the distribution. On Debian/Ubuntu system pick the 'No Configuration' option.

Now, archive the package maintainers configurations, and we'll start hacking our own.

~ # rsync -a /etc/postfix/ /etc/postfix.dist/

Disable Services

To make this null mailer function nicely and consume less resources we remove a number of the Postfix services. Here are the minimal requirements in master.cf, see man 5 master for more information.

pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
	-o smtp_fallback_relay=
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard

Configure main.cf

This is a well stripped down main.cf file, only the minimum necessary values have been adjusted.

allow_percent_hack = no
biff = no
bounce_queue_lifetime = 2h
default_destination_concurrency_limit = 2
disable_vrfy_command = yes
initial_destination_concurrency = 2
maximal_queue_lifetime = 4h
message_size_limit = 4096
mydomain = [your domain]
myhostname = [this host fqdn]
mynetworks = [ip list, or hash file]
smtpd_banner = $myhostname - edoceo private smtp
smtpd_client_restrictions = 
smtpd_helo_required = yes
smtpd_helo_restrictions = 
smtpd_recipient_restrictions = permit_mynetworks, reject
smtpd_sender_restrictions = 
strict_mime_encoding_domain = yes
strict_rfc821_envelopes = yes