I found that this configuration works quite well:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtp_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtp_use_tls=yes
smtp_tls_security_level = encrypt
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = yourhostname.as.fqdn
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = yourhostname.as.fqdn, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = 127.0.0.1
# Use this, if you want to authenticate with your mailsever
# You need an account there...
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
# Do not remove the []
relayhost = [yourmailserver.fdqn.goes.here]:submission
If you use the SMTP Authentification, also create a /etc/postfix/sasl_passwd
:
[yourmailserver.fdqn.goes.here]:submission account@yourmailserver.blub:thisisthepassword
Then run postmap /etc/postfix/sasl_passwd
to create the hash database.
The crucial part is to set an alias in /etc/aliases
to point all mails to your logging account.