Vpopmail Virtual domain post installation config and tuning of quotas and domain aliases

Wednesday, 23rd June 2010

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

Share this on:

Download PDFDownload PDF

Tags:

6 Responses to “Vpopmail Virtual domain post installation config and tuning of quotas and domain aliases”

  1. Vesko says:
    Firefox 4.0.1 Firefox 4.0.1 Windows XP Windows XP
    Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

    Is there a way to tell vpopmail to return only the text in over-quota.msg and not to include original message returned to the sender “— Below this line is a copy of the message. … …. “

    View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      Hi Vesko,

      As far as my understanding goes ‘Below this line is a copy of the message’ is impossible to be changed via vpopmail as this text is not included by vpopmail at all.

      ‘— Below this line is a copy of the message.’ is included as a text within the failure message generated by the FAILURE-DAEMON by the qmail-send program.

      I believe the only way to solve that is to modify the source file of qmail-send (something which is not recommended) as you might break the failure notice messages RFC compliance.
      You can read about qmail-send here:
      http://cr.yp.to/proto/qsbmf.txt

      Hope this helps.

      Wish you Best!
      Georgi

      View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      Hi Vesko, I don’t know how can you remove the attached message after a MAILER-DAEMON.
      Even if you find a way I’m not sure it’s a wise idea as I think according to RFC mail specifications, it’s prescribed that the failed message is being delivered as attachment with the MAILER-DAEMON failure notice email.
      Why do you want to remove the actual message, do you have issues with large emails which does load the qmail server?

      View CommentView Comment
      • Vesko says:
        Firefox 4.0.1 Firefox 4.0.1 Windows Vista Windows Vista
        Mozilla/5.0 (Windows NT 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

        Thanks for guiding, I have an issue with a userA@domainA.com (MS Exchange, I think) sending large att to userB@domainB.com. userB is over quota, and doesn’t get message, qmail at domainB.com returns the message but exceeds the max_allowed_size at domainB.com. So neither the userA gets the returned message, nor the userB gets the original message.
        I think domainA.com has different allowed size of message for sending and receiving.
        I wanted to cut only larger attachments that are returned. I didn’t use .quotawarn.msg till now, and hope it can help.

        View CommentView Comment
        • admin says:
          Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
          Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

          Hi I would say it’s best that you configure the the max message size your qmail mail server (I assume you use qmail) to be to a certain size. If you use something like clamav or simscan you can do that on through the AV or probably via spamassassin.
          Your guess sounds quite logical to me.

          .quotewarn will send warning email to the user which mailbox gets filled in, so in a sense either he can contact the administrator (I guess you) or alternatively if the user has access to some kind of vpopmail user config interface that allows him to raise his quiote (which is not very likely :))

          To prevent too large emails which might lead to overloads of your mail server, there are some patches on qmail.org which might be helpful.

          Hope this is helpful.
          If I can help further I’ll be glad.

          Best!
          Georgi

          View CommentView Comment

Leave a Reply

CommentLuv badge