Vpopmail Virtualdomain post installation config
and tuning of quotas and domain aliases
Many qmail+vpopmail install tutorials online give a good insight on
how to install vpopmail on top of a qmail mail server.
However very few of them explain on how to setup and configure the
basic vpopmail policy concerning new user creations.
For instance have you ever wondered how can you configure your
vpopmail to create all new users by default with a quota limitation
of 500MB?
I bet you have.
In this small post I'll discuss on how to setup (configure) the
default policy concerning user creation of new virtual domain users
in vpopmail.
1. In order to configure the maximum amount of new created users
quota and the maximum number of messages a user mailbox may hold in
vpopmail you should edit ~vpopmail/etc/vlimits.default
debian-server:~# vim ~vpopmail/etc/vlimits.default
Then put in the vlimits.default file:
# 500MB
default_quota 524288000
# maximum number of messages in a mailbox
default_maxmsgcount 10000
The above two vpopmail vlimits.default configuration directives are
to set your new usernames user@yourvirtualdomain.com to
default_quota of 500 MB, which I suppose in most cases would be
enough for most users, it will also set the maximum numbers in a
mailbox to be equal to 10000 mail messages
2. Furthermore it's necessary that we create .over-quota.msg and
the .quotawarn.msg
debian-server:~# touch
/var/vpopmail/domains/.quotawarn.msg
debian-server:~# touch
/var/vpopmail/domains/.over-quota.msg
Put in .quotawarn.msg something similar to the text:
From: Postmaster <postmaster@mydomain.org>
Reply-To: postmaster@mydomain.org
Organization: My Organization
To: User:;
Subject: Mail quota exceeding
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1251
Content-Transfer-Encoding: 8bit
Dear User,
The size of your mailbox has exceeded a warning threshold,
that is set by the system administrator.
Please contact our IT Department:
email:me@mydomain.org
Tel.: +359 (42) 601694
Thereafter, it's a necessity to put in the .ovar-quota.msg the
text
Message rejected. Not enough storage space in user's mailbox
to accept message.
Having done that we need to set the proper permissions for the
newly created files:
debian-server:~# chown vpopmail.vchkpw
/var/vpopmail/domains/.*msg
Note that if your vpopmail is installed in a different location
than the default one /var/vpopmail it will be required that you set
the proper location in the touch and chown commands foreshown
above.
Then it's probably idea to add a mail alias if your mail server
domain is mail.example.net and your primary mail vpopuser domain is
example.net issue the command:
debian-server:~# /var/vpopmail/bin/vaddaliasdomain
mail.example.net example.net
Tt's an interesting fact that I mistakenly did the domain alias the
other way around with a command: debian-server:~#
/var/vpopmail/bin/vaddaliasdomain example.net
mail.example.net
instead of
debian-server:~# /var/vpopmail/bin/vaddaliasdomain mail.example.net
example.net
I therefore wanted to reverse the alias in order to instruct
vpopmail's virtualdomain alias to be from mail.example.net to point
to example.net.
Fortunately I found out that actually the domain alias though my
wrongly inverted syntax has added itself the domain alias in a
correct way, I got that by checking the domain information with
/var/vpopmail/bin/vdominfo