18 thoughts on “How to Install and Configure an Email Server on Ubuntu 24.04”

  1. Hi,

    Not sure if I have done something wrong, but I’m fairly sure I have followed the steps exactly:

    When I get to:

    sudo nano /etc/postfix/sql/mysql_virtual_alias_maps.cf

    there is no such file. Upon checking, the directory (/etc/postfix/sql/) exists, but is completely empty.

    Any suggestions welcome :-)

    Reply
  2. Ignore me – I am supposed to be creating that file in the next command, rather than editing one that is already there.

    Apologies!

    Reply
  3. You are missing dovecot-lmtpd when installing dovecot. Without it local mail delivery doesnt work and you will get the following error in maillog
    conversation with mydomain.com[private/lmtp] timed out while receiving the initial server greeting

    Reply
    • Please check if you followed all the instructions correctly on steps 5 and 6. You can also check the error logs for more information about the issue you are facing.

      Reply
  4. Hello,
    Thanks a lot for this.
    Smtp is working fine but I have problems with IMAP, IMAPS, POP3 and POP3S.
    Nothing come from outside, all ports are open in firewall :110, 143, 465, 587, 993, 995
    Why all these ports are commented in dovecot config file by default ?
    Should I uncommented them ?
    Thanks for your help.
    Marti

    Reply
  5. i have a problem whith dovecot.service, because says that have a conflict whit:
    Failed to start dovecot.service – Dovecot IMAP/POP3 email server.

    Reply
    • The following command may give you more information why Dovecot didn’t start:
      systemctl status dovecot

      Also, you can check the mail server logs.

      Reply
  6. I know I’m new to Linux so go easy on me. When I run the following command:

    sudo postconf -e “myhostname = $(hostname -f)”

    I get the following error:

    postconf: fatal: open /etc/postfix/main.cf for reading: No such file or directory

    When I look in that directory. I do not see that file, but I do see main.cf.proto.

    Any help appreciated.

    Thanks!

    Reply
    • After installing Postfix, you should see the main.cf file under the directory /etc/postfix/. You can try to reinstall postfix by executing this command apt install postfix --reinstall

      Reply
  7. In roundcube with $config[‘smtp_host’] = ‘tls://%n:587’;
    I get SMTP Error (): Connection to server failed.

    If I change it to $config[‘smtp_host’] = ‘%n’;
    I get SMTP Error (): Authentication failed.

    When Trying to send an email

    Reply
  8. Roundcube SMTP auth Failure when using user name and password, butcan send email with no user name or password

    Also, $config[‘smtp_host’] = ‘tls://%n:587’; stops roundcube from even communicating with the SMTP server.

    Reply
    • It’s not possible to send emails without logging in to Roundcube. As mentioned earlier, you can check your mail log for more information about this. If you follow this article carefully, there will be no issue logging in to Roundcube and sending emails using your own domain name.
      Also, if you have an issue with Roundcube, you can install a mail client like Thunderbird and use it to send emails.

      Reply

Leave a Comment