Install a Complete Mail Server with Postfix and Webmail in Debian 9

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Matei Cezar

I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

43 Responses

  1. Swemg says:


    If I do this along a web server, could it be an issue?


  2. yaswanth says:

    Hi, I am having problem at 12th line, where we have to create Mailsdir?.

    I did not get any files in the folder.

  3. Eric says:

    Hi Guys,

    I’m having some problem at step 20: I type nc lohalhost 25 and nothing happens.

    it just stays there.

  4. Lucas Sánchez says:

    It is working perfectly,

    I only have one question, as long as I log in using the domain, log in correctly to the Rain Loop site, but the domain is no longer used and the ip server is always used in the url, how could I configure this?

    Thank you

  5. Rafael says:

    Inbox appears to be empty on Rainloop Webmail client! To resolve comment the line # HOME / Maildir now change in 10-auth.conf

    mail_location = maildir: ~ / Maildir to mail_location = maildir: ~ / mail
    # systemctl restart dovecot.service

    All emails now appear.

  6. Sergio says:

    Somebody knows what is the font on the screenshots?

  7. Kenneth says:

    Everything’s worked of the installation, only i don’t get the /Maildir folder. So no mails for root of other users. What can i do?

  8. Eric says:

    I strongly discourage following the directions in this article, without understanding what you are doing. These technologies are dated from the 1980’s, do not include any modern security, and transmit your login information across the Internet in plain text. This article asks you to override the more secure Dovecot default options here:

    disable_plaintext_auth = no
    auth_mechanisms = plain login

    There is a reason those mechanisms are disabled by default today.

    I’d like to see this article cover proper outgoing mail delivery (as in, send mail FROM to Internet hosts, as well as being able to receive messages). Most ISPs would prevent you from sending outgoing messages because they prohibit outgoing traffic on port 25.

    Additionally, security is mandatory nowadays, and any e-mail sent using a system that actually worked with just these directions, would go straight to your recipient’s spam folder (or be rejected outright) because this does not cover TLS encryption in transit. Additionally, it doesn’t address DNS requirements such as MX records, SPF validation, or DKIM signing. This is hardly a “complete” mail server.

  9. Tanner says:

    Mr Saive,

    I got as far as step 21.

    In the /home/matie/ part of my file system, there was no Maildir directory so I created a Maildir and new. (/home/matie/Maildir/new/).

    Should I repeat step 20 keep the following syntax?

    mail from: root
    rcpt to: matie

    I have done this several times and logged in as matie and root and used the command “mail” only to get “No mail for root/matie.

    Anything helps

  10. Erik Nieuwenhuis says:

    Works! Thanks a lot

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.