Postfix on KPN Direct ADSL


I had a lot of trouble setting up Postfix so that it would relay my mail (sending only). I am using KPN Direct ADSL and have documented some tricks here for Ubuntu 12.10.

KPN’s support answer is somewhat useful but not that much:

The three different addresses they are mentioning for the relayhost, confused me a lot. The right relayhost to use is:

My /etc/postfix/ looks like this:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = <hostname>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = <externaldomain>, <hostname>, localhost
relayhost = []
mynetworks = [::ffff:]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
default_transport = relay
relay_transport = relay
inet_protocols = all

Please make sure that you replace <hostname> and <externaldomain> with your machine’s hostname and external domain URL.

The last I found with to get my external ip address and to get your external domain URL:

host <ip-address>

Notice that I had to change the default_transport and relay_transport to error to:

default_transport = relay
relay_transport = relay

The other thing I had to do is to set the following to change rewrite the from field as KPN does not accept the <user>@<hostname> that your Ubuntu machine provides:


To set up your sender_canonical file, follow these instructions:

Useful background information can be found here:

Posted on December 17, 2012, in Linux, Quantal Quetzal, Technology, Tips and tricks, Troubleshooting, Ubuntu and tagged , , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: