Mail relay instructions not accurate for Ubuntu 18.04


Hi. Perhaps i’m doing something wrong, but I can’t get mail relay to work following the instructions here:

I am using Ubuntu 18.04 on both the mail server and the remote server.

I did get it working in the end, with the following changes:

On the remote server, I had to specify the relayhost in /etc/postfix/, for example relayhost = If I don’t specify relayhost, then mail is not relayed at all.

On the mail server, to prevent “Relay access denied;” errors, I had to include the IP addresses of the remote server. In /etc/postfix/, I updated to mynetwork" field to include the IPV4 and IPV6 addresses of the remote server, for example: mynetworks = [::ffff:]/104 [::1]/128 X.X.X.X X:X:X:X::1

Now mail relay works correctly from the remote machine. I understand the docs here mention the info is valid for Ubuntu 14.04 but i didn’t expect the approach to be different for 18.04.

Am I doing something wrong that I have to make the changes mentioned above? Or is this correct approach for Ubuntu 18.04?


I wouldn’t either … I took a look at Sendgrid’s guide to Integrate with Postfix at: and the same line is required there, so maybe it is something that was missed? I am going to set up a VPS and experiment to see. Thanks for posting this … if the relayhost is required, I will put in a pull request to update the website. :slight_smile:

closed #3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.