What We Need To Do

Previously in this module, when installing and configuring Postfix, we edited Postfix's Main.cf file.

When we did that, we set an argument inet_interfaces to all so that our emails would work properly.

However, since we'll be creating a network bridge within our server for Postfix to communicate with Docker, we need to re-visit our Main.cf file to restrict that access to only the specific network bridge we will create when we invoke our docker-compose.yml file.

This step is necessary to ensure proper email encryption and SMTP security.

How We Need To Do It

Let's first re-open our main.cf file with the following command:

sudo nano /etc/postfix/main.cf

Now scroll down until you see the following argument:

inet_interfaces = all

Change it to the following:

inet_interfaces =,gateway

Replace gateway with the gateway you've established for your Bitwarden server in the docker-compose.yml file. Remember, that in our example it was

Here's what it should look like when you're done.

Once you've made that change, save and exit this file.

Restart Postfix

With that done, from your Command Line Interface enter the following command to restart Postfix and make sure your changes are loaded.

sudo systemctl restart postfix

Please note, that after making this change emails will no longer work until later on in the course when we invoke our docker-compose.yml file and actually create the network bridge we just referenced.

Congratulations on completing this module and setting up your server to send encrypted SMTP emails. Now let's move on to installing Docker!