At the time of this writing, installing the default Qmail package on Ubuntu 18.04 does not automatically install at least one necessary dependency to make Qmail work. Let’s manually install that package: sudo apt-get install daemontools-run. To install Qmail, run the following: sudo apt-get install qmail. Let’s create a Maildir directory.
- Install with source. Run the following command (As non-root user) tar zxf cd (Now read the INSTALL file and follow the steps to install Qmail) -Example. (As non-root user) tar zxf release-18.tar.gz cd release-1.03 vi INSTALL (Read and follow steps) 2.4. Install Courier-imap.
- . Makefile: install the qmail-verify service directory. qmailctl: additionally handle the qmail-verify service. tcp.smtp: add:allow,VERIFY='DEFER'. debian/qmail-run.postinst: add qmail-verify service to system-wide service supervision. debian/control: Depends: qmail (= 1.06-2.1) (1st version with qmail-verify functionality.
- Sudo apt install composer. Now, we need to change to the roundcube directory. Cd /var/www/roundcube. And use composer to install dependencies. Composer install -no-dev. If you get nothing to install or update – you are good to go. Next, we will need to create database for Roundcube.
For a general overview of mail systems, please see greycat's mail tutorial.
Exim
How do I reconfigure exim like I did when I installed Debian?
For Lenny and Etch:
How can I test where my mail is going?
You can use exim's built-in address testing functions, for example:

Postfix
qmail
qmail is distributed under a licence which prohibits the distribution of modified binaries. Debian's policy requries that mail transfer agents conform to certain standards in order to be included in Debian as packages. qmail doesn't meet all of these standards in its standard upstream form, so it's impossible for Debian to distribute a qmail binary package which satisfies both policy and upstream's license.

This leaves two choices: you can either build qmail from Debianized sources (qmail is included in source-code-plus-patch form in the non-free section of Debian); or build it yourself from upstream sources and use the equivs package to provide the mail-transport-agent virtual package.
For newcomers, the Debianized sources are preferred, because the task is much simpler. Just do:
Then, you may have to get rid of any other MTA package, if there's one in the way:
Apt-get Install Mailutils
Be sure to follow any additional instructions which are provided along the way.
For those of you who prefer the other method:
Apt Get Install Ubuntu Desktop
Then you're on your own in terms of patching and building qmail, setting up boot-time invocation scripts, and so on. (Some of the newbies who are reading this will wonder why anyone would want to make it this hard. Please believe us when we say that this is a common mindset among qmail users, and this is a frequently asked question.)
Mutt
How can I make Mutt rewrite my From: address
Put a line like the following in your ~/.muttrc file.
Other
I don't want to run a local MTA; I just want all my mail to use my SMTP server.
You must replace your MTA with one of the packages that are designed to hand all the locally generated mail to a 'smart host'. For example:
CategoryMail
I make it a goal to do as little custom configuration work as possible. No building from source, no third-party package repositories, and restricting myself to use a core, stable subset of system features when building software. Performing a package or OS upgrade only to find that some bleeding edge feature you were using has changed is frustrating at best, a lurking security hole at worst.

As a result, my preference for Qmail as a MTA may seem odd, given that Qmail is perceived as challenging to configure. However, when it comes to secure, set-and-forget software, Qmail is just about as good as it gets. It’s the Fort Knox of MTAs: highly efficient and designed to be secure. While it may appear a bit difficult to get started, once you understand the way Qmail approaches mail delivery, you’ll never go back to any of the otherbuggyMTAs.
But for those of us that use Ubuntu, there’s a problem. The Ubuntu package for Qmail, though stable, is somewhat outdated. It lacks several important patches such as the CNAME patch, which simply makes DNS lookups more efficient. Why is this important? Because if you don’t apply this patch, sites with large DNS records will trigger temporary failures (“CNAME lookup failed temporarily”) until Qmail finally gives up and bounces the outgoing message. There are workarounds (editing the smtproutes configuration, in this case), but they’re tedious and require ongoing oversight.
The list of useful Qmail patches is fortunately rather short, but would require a custom build of Qmail, which in my case is unworkable. I use Puppet to configure all of my servers, so handling custom package builds becomes a more serious challenge, not to mention requiring the entire suite of build tools on the server.

With a just-in-time custom build ruled out, the best remaining option in the Ubuntu ecosystem is to create a Personal Package Archive on Launchpad, Canonical Ltd’s third-party package repository. With a PPA, I can upload my patched Qmail source package, at which point Launchpad will build and host packages that are easily imported into the Ubuntu package manager.
In the interest of simplicity, instead of modifying the original Qmail source, I followed the package manager’s convention and applied the changes as a series of patches. Some applied cleanly, without any additional modification. Others (particularly the Qmail Authentication patch) required extensive rework to accommodate changes from the other patches.
In the end, I added 6 additional patches to Qmail:
- 0004 – Remove the CNAME lookup (per DJB himself: “It’s safe to simply skip the CNAME lookup: i.e., have dns_cname simply return 0”)
- 0005 – Handle large DNS responses (would also have solved the above problem – I applied both since the CNAME lookup is no longer useful and is extra work)
- 0006 – Return “Unrecognized” instead of “Unimplemented” for non-existent SMTP commands
- 0007 – Screen for and reject email addresses with relay characters
- 0008 – A host of inbound and outbound SMTP AUTH authentication patches
- 0009 – Support for external recipient validation via the RCPTCHECK environmental variable
The source is on Github and the packages are built and available via Launchpad; instructions for incorporating them into your Ubuntu install are there as well. I’ve been running the new build in production on a handful of servers and haven’t experienced any problems yet. If you find one though, send a pull request on Github and send me an email. I’ll incorporate it, rebuild, and republish the package.