Guide updated on 29th of February 2016

Install Vpopmail

Vpopmail is one of the major components of this installation. Vpopmail allows us to do virtual domain mail hosting. It's got a lot of built in tools and features that make it a dream to work with. Even if you don't want to host mail for multiple domains, I would still recommend installing Vpopmail. It just makes the whole mail game easier. Plus, this installation centers around it, so if you don't install it you're going to have a headache.

Create the needed Database.

The used MySQL_root_password should be the password chosen on pre-step 3. It's should not be the same as the password for vpopmailuser (VPOPMAIL_PASSWORD).

It's not a typo, the MySQL_root_password should really be just aside the -p

mysql -pMySQL_root_password

GRANT select,insert,update,delete,create,drop ON vpopmail.* TO vpopmailuser@localhost IDENTIFIED BY 'VPOPMAIL_PASSWORD';

Test your the account you have just created

mysql -uvpopmailuser -pVPOPMAIL_PASSWORD

You should have such response

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1073
Server version: 5.5.47-0+deb8u1 (Debian)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


Prepare the installation

mkdir -p /home/vpopmail/etc
chown -R vpopmail:vchkpw /home/vpopmail
chmod 770 /home/vpopmail
cd /home/vpopmail/etc

Do not forget to put your OWN chosen MySQL password for vpopmailuser (refered as VPOPMAIL_PASSWORD in this guide)

echo "localhost|0|vpopmailuser|VPOPMAIL_PASSWORD|vpopmail" > ~vpopmail/etc/vpopmail.mysql
chown vpopmail:vchkpw ~vpopmail/etc/vpopmail.mysql
chmod 640 ~vpopmail/etc/vpopmail.mysql

Install Vpopmail

cd /downloads/
tar zxvf vpopmail-5.4.33.tar.gz
cd /downloads/vpopmail-5.4.33

./configure \
--enable-qmaildir=/var/qmail/ \
--enable-qmail-newu=/var/qmail/bin/qmail-newu \
--enable-qmail-inject=/var/qmail/bin/qmail-inject \
--enable-qmail-newmrh=/var/qmail/bin/qmail-newmrh \
--enable-tcprules-prog=/usr/bin/tcprules \
--enable-tcpserver-file=/etc/tcp.smtp \
--enable-clear-passwd \
--enable-many-domains \
--enable-valias \
--enable-qmail-ext \
--enable-logging=p \
--enable-auth-logging \
--enable-sql-logging \
--enable-auth-module=mysql \
--enable-incdir=/usr/include/mysql \
--enable-libdir=/usr/lib/ \
--disable-mysql-limits \
--disable-roaming-users \

make && make install-strip

You can find HERE all compilation options.

Note that vpopmail is not configured here with spamassassin option. This is is due to the fact spamassassin will be used during the SMTP conversation thanks to Simscan. Nevertheless, if you want spamassasisn to be used during local delivery to Maildir (=to mailbox), just add the configuration option --enable-spamassassin

This file modification is needed to avoid a segmentation fault in some case

cat > ~vpopmail/etc/vusagec.conf << __EOF__
    Disable = True;

Put binaries into $PATH variable

echo 'export PATH=$PATH:/var/qmail/bin/:/home/vpopmail/bin/' > /etc/profile.d/
chmod +x /etc/profile.d/
source /etc/profile

Install Vqadmin

Users comments
Shakoori - 19/01/2014 18:30


when I execute "make && make install strip"

I get a messag:


if you plan to use the vpopmail usage daemon run the following commands:

cd vusaged && ./configure && make

Then follow the INSTALL file to install.


Make [1]: Leaving directory '/downloads/vpopmail-5.4.33'


Thibs - 31/05/2013 20:17

Nicolás: It's possible to set a quota via vqadmin

Nicolás - 30/05/2013 17:36


I want to set a domain quota, but searching on web it seems that vpopmail doesn't support this natively, in fact, the way to do this is with linux quota's.

Do you know another method for this? is ok that vpopmail doesn't support this?


Keven - 04/12/2012 18:21

@Thibs  yes, I have tested it. if you don't config as  

--enable-many-domains = y

vpopmail create table by your domains, not vpopmail as mysql table.

Check the configue file of vpopmail, you can see

case $MANY_DOMAINS in   1*|y*|Y*)

It seem that it only accept "1|y|Y" as pamameters for enable multi domains.

and vpopmail will check if you config with pamameter "enable-many-domains".

See this code:

if test "${enable_many_domains+set}" = set; then :

  enableval=$enable_many_domains; MANY_DOMAINS=$enableval

if  find you configure with enable_many_domains, vpopmail will pass it's value to MANY_DOMAINS.

but if you config vpopmail with "enable-many-domains", and value "y" missed, then there is nothing passed to MANY_DOMAINS. 


So, multi domain function is disable.

if you do not configue with this pamameter, MANY_DOMAINS = y by default.

the code here:


if test "${enable_many_domains+set}" = set; then :

  enableval=$enable_many_domains; MANY_DOMAINS=$enableval





Thibs - 29/11/2012 10:19

@Keven Are you sure ? I have made a script especially to convert MySQL database designed to serve vpopmail compiled with "enable-many-domains" into a databases designed to server vpopmail compiled with "disable-many-domain"


Moreover, I remember a talk on vopmail mailing list about the difference between with enable/disable-many-domains ... and nobody (including the developer) told me about that.

Finally, I can tell you that I have more than 250 domains running on a server with such config


Keven - 26/11/2012 07:10

Hello  Thibs,

there is an error in your setting.

you should configure with enable-many-domains="y", or you can not active mult domain with mysql. check your mysql tables.

if you already configure with " enable-many-domains", you should re-install with " enable-many-domains=y",and re- install vqadmin and qmailadmin.

if not, you will get error with authentification of courier and Roundcubemail.

best regards.

Hip0 - 28/09/2012 16:43

Hi Thibs,

I have writen article explaining how to compile vpopmail with support for storing mails and userdata on disk. This was option in original qmailrocks installation. Unfortunately in yours I don't see it link to explanations how I did it is here -

Hope the article will be useful to people interested in doing courier-imap+vpopmail without mysql support.



Thibs - 03/08/2012 11:24

@Syngin : First of all thanks for your tests ! FYI this package installation was described package-install.php

Syngin - 30/07/2012 20:12

Ran into an issue on Wheezy during the config portion:

configure: error: Unable to find your MySQL inc dir, specify --enable-incdir.

The following fixed it though.

 apt-get install libmysqlclient-dev

Tom delombarde - 11/04/2012 18:51

Running Debian Squeeze kfreebsd, add:


to the configure command above ...

Thibs - 30/01/2012 21:58

@Goofy : I'm currently really busy and I don't have time to update the site ... but I confirm that David's tips is working. Just check his another comment on configure-courier.php

Goofy - 30/01/2012 13:36

I'm interested to know how to apply the --disable-clear-password.

I waited with the installation of qmail because of this cullprit.

Any advice will be greatly appreciated.

Thibs - 08/12/2011 23:01

@David : yes and it worked. I still have to test it on another install but 'm quite sure you were right ! Thanks for the tip (I'll update the site soon)

David - 30/11/2011 13:26

Hey Thibs,

Have you checked out if my disabling of cleartext passwords works properly in your setup yet?


Thibs - 13/11/2011 22:42

@Jon : My known solution is to use qmail server with authentification through port 465. It works for roaming and non-roaming users!

Thibs - 13/11/2011 22:40

Hello David,

Thank you for your contribution. I'll test it as soon as possible (unfortunately probably not this week) and adapt the guide if your solution is confirmed !

Jon - 13/11/2011 21:16

How do you enable roaming users to send mail now?

This isn't a dumb question, it is a major problem since many people use smart devices and login remotely. Our company has a policy of sendng all mail through our server.


David - 13/11/2011 14:08

configure-courier >> Which is what has been failing on me for the last 12 hours.

Well, now that solves that.

But honestly, there must be a way around this.

What exactly is the issue there? Why wouldnt it be able to work without it?

I see guides for gentoo [albeit using postfix] that solve this issue by using cyrus-sasl [a package], describing it as "We're going to slave SASL off Courier-authlib instead of having it talk directly to the database. This allows us to use encrypted passwords and seems to work better as well. "

Let me know your thoughs about this.

Thibs - 13/11/2011 10:42

Hello David,

The effect of this option is to enable a "pw_clear_passwd" field in database structure.

This can indeed been considered as an insecure way of doing .... but I unfortunately absolutely need it in configure-courier.php

Thank you anyway for pointing this !


David - 13/11/2011 01:11

In reference to the ./configure options for vpopmail:


I personally think it's irresponsible nowadays to leave cleartext passwords lying around systems.

Qmail has a name for its security. Saving cleartext passwords is not necessareley unsecure, but is enormous potential fir a HUGE security leak under many aspects.

This should be changed to:



If you've already installed vqadmin/qmailadmin[not sure about the latter], remember it must be recompiled after re-installing the updated vpopmail in order to itself not save cleartext passwords as well.


Color Coded Qmail Installation Key
  Regular Black Text     Qmail installation notes and summaries by the author.
  Bold Black Text     Commands to be run by you, the installer.
  Bold/Regular Red Text    Vital and/or critical information.
  Regular Blue text     Denotes helpful tips and hints or hyperlinks.
  Regular Orange Text     Command line output.
  Bold/Regular green text     Denotes the contents of a file or script.