Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 8th January 2008, 17:11
volksman volksman is offline
Senior Member
 
Join Date: May 2007
Posts: 124
Thanks: 2
Thanked 16 Times in 14 Posts
Default 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?
Reply With Quote
Sponsored Links
  #2  
Old 8th January 2008, 18:36
volksman volksman is offline
Senior Member
 
Join Date: May 2007
Posts: 124
Thanks: 2
Thanked 16 Times in 14 Posts
Default

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 README_FILES/VDA_README
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?
Reply With Quote
  #3  
Old 9th January 2008, 03:16
shark_tico shark_tico is offline
Junior Member
 
Join Date: Oct 2006
Location: San Ramon, Costa Rica
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
Default same issue

I have the same issue

Any suggestion ?
__________________
Fabio Benavides
www.unavidaconproposito.com
Reply With Quote
  #4  
Old 9th January 2008, 16:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Did you modify the quota_notification as shown in the tutorial? There are two lines in the script where you must add a % sign.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 9th January 2008, 19:36
volksman volksman is offline
Senior Member
 
Join Date: May 2007
Posts: 124
Thanks: 2
Thanked 16 Times in 14 Posts
Default

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.
Reply With Quote
  #6  
Old 9th January 2008, 21:17
shark_tico shark_tico is offline
Junior Member
 
Join Date: Oct 2006
Location: San Ramon, Costa Rica
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
Default maildirsize file doesn't exist

Like volksman the maildirsize file doesn't exist.
__________________
Fabio Benavides
www.unavidaconproposito.com
Reply With Quote
  #7  
Old 10th January 2008, 15:50
volksman volksman is offline
Senior Member
 
Join Date: May 2007
Posts: 124
Thanks: 2
Thanked 16 Times in 14 Posts
Default

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.....
Reply With Quote
  #8  
Old 10th January 2008, 18:30
volksman volksman is offline
Senior Member
 
Join Date: May 2007
Posts: 124
Thanks: 2
Thanked 16 Times in 14 Posts
Default

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:

Code:
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:

Code:
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:

Code:
mv maildirfix /usr/local/sbin/
chown +x /usr/local/sbin/maildirfix
Change the DB info:

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

Quote:
my $DBN = "mail";
my $DBU = "DBUSER";
my $DBP = "DBPASSWORD";
my $DBH = "localhost";

Now add it to your crontab:

Code:
crontab -e
Quote:
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.
Attached Files
File Type: gz maildirfix.tar.gz (1.1 KB, 263 views)
Reply With Quote
The Following User Says Thank You to volksman For This Useful Post:
falko (11th January 2008)
  #9  
Old 24th January 2008, 17:22
thecaoticone thecaoticone is offline
Member
 
Join Date: Nov 2007
Posts: 89
Thanks: 1
Thanked 18 Times in 16 Posts
Default Found the problem

Check your postfix main.cf file and see if this helps.

http://www.howtoforge.com/forums/showthread.php?t=19765

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
Reply With Quote
  #10  
Old 5th November 2011, 10:27
Obiwan1965 Obiwan1965 is offline
Junior Member
 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
 
Smile 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!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Hosting With PureFTPd And MySQL quota problem GaulHahn Server Operation 3 29th July 2008 14:32
Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs ruskicar HOWTO-Related Questions 26 20th July 2007 16:28
Virtual Users And Domains With Postfix, Courier Increase quota herbie HOWTO-Related Questions 1 24th January 2007 22:08
Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs mholownych HOWTO-Related Questions 10 29th May 2006 03:39
postfix config jmroth Installation/Configuration 6 18th September 2005 15:58


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


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