HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   HOWTO-Related Questions (
-   -   Virtual User/Postfix/Courier/Mysql Etc....Quota Issues (

volksman 8th January 2008 18:11

Virtual User/Postfix/Courier/Mysql Etc....Quota Issues
I run the quota_notification script and it sends me a blank e-mail. After some running through the script it seems to die when looking for the maildirsize file. When I look by hand the files aren't in any of my user dirs.

Did I screw something up when applying the quota patch to postfix? How do I get those files to show up?

volksman 8th January 2008 19:36

Anyone else having issues with this in Gutsy?

I just downloaded and recompiled postfix to make sure there were no errors and I don't see any:

patch -p1 < ../postfix-2.4.5-vda-ng.patch
patching file src/global/mail_params.h
patching file src/util/file_limit.c
patching file src/virtual/mailbox.c
patching file src/virtual/maildir.c
patching file src/virtual/virtual.c
patching file src/virtual/virtual.h

No errors after dpkg-buildpackage

Installed packages and restarted postfix sent an e-mail to a user but there is still no maildirsize file in the users Maildir....

Any suggestions?

shark_tico 9th January 2008 04:16

same issue
I have the same issue

Any suggestion ?

falko 9th January 2008 17:50

Did you modify the quota_notification as shown in the tutorial? There are two lines in the script where you must add a % sign.

volksman 9th January 2008 20:36

yep. its not really a problem with the reporting script.

It's a problem with either postfix or courier not creating or maintaining the 'maildirsize' file in the actual mail store directory.

shark_tico 9th January 2008 22:17

maildirsize file doesn't exist
Like volksman the maildirsize file doesn't exist.

volksman 10th January 2008 16:50

I just setup a test account with a 1000 byte quota and it bounced an e-mail I sent to the account saying it was over quota. Postfix does enforce the quota. So it must be using something other than using the maildirsize file to enforce it.

Still digging but thought I would put that out there.....

volksman 10th January 2008 19:30

1 Attachment(s)
I've created a quick fix to this problem for now. It's really just a hack and probably wouldn't be all that great if you have a LOT of users but it works:

First you will need to install the Mysql module for Perl. This can be done by running the following in a shell:


perl -MCPAN -e shell
If you've never used the cpan shell before you will need to go through the setup. I can't really help with that (mostly defaults but you are on your own).

Once you get to a prompt type the following:


cpan> force install Bundle::Mysql
That should force it in (it will die if it can't connect as root to your DB).

Then you need to put the script somewhere, so download it and get it on your server:


mv maildirfix /usr/local/sbin/
chown +x /usr/local/sbin/maildirfix

Change the DB info:


vi /usr/local/sbin/maildirfix
and edit the lines as approprate:


my $DBN = "mail";
my $DBU = "DBUSER";
my $DBH = "localhost";

Now add it to your crontab:


crontab -e

0 23 * * * /usr/local/sbin/maildirfix &> /dev/null
This will run it one hour before the quota_notify script is triggered if you followed the howto.

thecaoticone 24th January 2008 18:22

Found the problem
Check your postfix file and see if this helps.

From the postfix-2.4.5-vda-ng.patch.gz sample config.

+# Enable Maildir++ extensions for faster maildir quota calculation
+# (maildirsize file and ",S=<size>" filename extension)
+# Needs Maildir++ compatible IMAP servers, like Courier-IMAP
+virtual_maildir_extended = yes

Obiwan1965 5th November 2011 11:27

maildirfix for DBI
This maildirfix script to fix the maildirsize file is exactly what I need, but the problem is I am running on Ubuntu 10.04. I am not familiar in perl so maybe somebody can help me.

Does anybody have a version with the usage of DBI in perl (use DBI;), which appears to be use instead of use Mysql;

Help or an adjusted version would be great!

All times are GMT +2. The time now is 06:06.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.