Search code examples
dnsubuntu-16.04postfix-mtamail-server

Mailserver on Ubuntu 16.04


I'm following this guide on how to install a mail server on Ubuntu 16.04 with postfix:

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-on-ubuntu-16-04

The problem is, when I get to step 7, I get the expected error Can't canonicalize "/home/<user>/Maildir"

But then when I run ls -R ~/Maildir, I get the error ls: cannot access '/home/<user>/Maildir': No such file or directory. When I make the directory and run mail I get the output /home/<user>/Maildir: Is a directory.

On my server, I have an MX record with Type: MX; Hostname: example.com; Value: mail.example.com; TTL(seconds): 14400, an A record with Type: A; Hostname: mail.example.com; Value: <ip_address_of_server>; TTL(seconds): 3600, and another A record of Type: A; Hostname: example.com; Value: <ip_address_of_server>; TTL(seconds): 3600.

The only thing I can think of is that my records are wrong, but everywhere I look, it seems like I'm doing it correctly. Can anyone see what I'm doing wrong?


Solution

  • You need to run this, it should work after that.

    $ sudo postmap /etc/postfix/virtual
    $ sudo service postfix reload
    

    Every time you edit virtual file, you need to run the above commands.