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 24th January 2008, 08:48
thecaoticone thecaoticone is offline
Member
 
Join Date: Nov 2007
Posts: 89
Thanks: 1
Thanked 18 Times in 16 Posts
Default Gutsy Postfix quota email fixed

I finally found my notes with the fix for the empty quota E-mails.

Gutsy is now working.

Make this change to your /etc/postfix/main.cf

change:
virtual_mailbox_extended = yes

to:
virtual_maildir_extended = yes

then reload postfix.

For a fresh install, send a test e-mail to your account. ( I used an attachment that was more than 1% of my quota. )

then login to the server as root and do:
/usr/local/sbin/quota_notify


You should now have an e-mail listing all users at 1% or more and the percentage of the quota used.

You may need to delete the /user/maildirsize file and let Postfix replace it when a new e-mail arrives.

This solution might work for Edgy & Feisty servers that are already running.
I can not promise this as I have not tested it.



It's amazing how one little change can make a difference.

One down side I have found, if I delete a message in a pop3 client it will not remove the message from the server. This I have to do with an imap client like Squirrelmail. Once deleted with the imap client the quota is updated. (this may just be a setting in my pop3 client )

Last edited by thecaoticone; 24th January 2008 at 13:16.
Reply With Quote
Sponsored Links
  #2  
Old 25th January 2008, 06:13
thecaoticone thecaoticone is offline
Member
 
Join Date: Nov 2007
Posts: 89
Thanks: 1
Thanked 18 Times in 16 Posts
Default pop3 client update

The problem with deleting messages via pop3 client was the developers felt the need to change a few things in Thunderbird 2.0

All is well now!
Reply With Quote
  #3  
Old 25th January 2008, 15:30
volksman volksman is offline
Senior Member
 
Join Date: May 2007
Posts: 124
Thanks: 2
Thanked 16 Times in 14 Posts
Default

Well here's the weird thing. I wrote that little script to manually build the maildirsize file on my system. I checked my maildirsize file before I made the above change and it was in the correct format (IE postfix or something else had modified it). Regardless I made the change to the config (box to dir) and restarted postfix. Sent myself an e-mail and nothing changed in the file. Deleted the file to let postfix re-create it (after sending myself a test). It did not.

So I ran my maildirfix script again and it created the maildirsize file. Sent myself an e-mail and Postfix updated the maildirsize file!?!

Something is weird here.....
Reply With Quote
The Following User Says Thank You to volksman For This Useful Post:
feeninuoumn (1st January 2014)
  #4  
Old 25th January 2008, 17:29
thecaoticone thecaoticone is offline
Member
 
Join Date: Nov 2007
Posts: 89
Thanks: 1
Thanked 18 Times in 16 Posts
Default

Okay, attached below is my main.cf file. The only thing I changed was the "box to dir".

The steps I took were:

1) box to dir

2) /etc.init.d/postfix reload

3) cd /home/vmail/domain.com

4) rm -rf user/maildirsize

5) send an email to user

6) nano user/maildirsize (made sure it was replaced)

7) /usr/local/sbin/quota_notify

8) received quota email

DAILY QUOTA REPORT:

----------------------------------------------
| % USAGE | ACCOUNT NAME|
----------------------------------------------
| 4 | user@domain.com |
---------------------------------------------

--
domain


main.txt

Last edited by thecaoticone; 26th January 2008 at 18:38.
Reply With Quote
The Following User Says Thank You to thecaoticone For This Useful Post:
AbannyvabVask (20th December 2013)
  #5  
Old 25th January 2008, 18:00
volksman volksman is offline
Senior Member
 
Join Date: May 2007
Posts: 124
Thanks: 2
Thanked 16 Times in 14 Posts
Default

What is the ownership and privs on your maildirsize files?
Reply With Quote
The Following 2 Users Say Thank You to volksman For This Useful Post:
AbannyvabVask (20th December 2013), feeninuoumn (23rd December 2013)
  #6  
Old 26th January 2008, 04:06
thecaoticone thecaoticone is offline
Member
 
Join Date: Nov 2007
Posts: 89
Thanks: 1
Thanked 18 Times in 16 Posts
Default File Permissions

Here is the result "ls -l" on one my regular users.

-rw------- 1 vmail vmail 21 2008-01-25 20:43

One thing I caught in you first response:

"Deleted the file to let postfix re-create it (after sending myself a test). It did not."

Sorry if I did not explain it clearly, but you need to delete the maildirsize file before sending the test e-mail. Then after the e-mail arrives, check to see if Postfix re-created the maildirsize file.

If we can get Postfix to create the file, then it should update when mail arrives to / removed from the server.

The problem I had was Postfix failed to create the file at all, which seems to be the same problem you are having.

Last edited by thecaoticone; 26th January 2008 at 05:57.
Reply With Quote
  #7  
Old 26th January 2008, 18:17
thecaoticone thecaoticone is offline
Member
 
Join Date: Nov 2007
Posts: 89
Thanks: 1
Thanked 18 Times in 16 Posts
Default Re-installed Gutsy

Just to make sure I am not leading you to an incorrect answer, I just re-installed Gutsy.

I used Falko's guide with following changes:

During setup installed:
LAMP server
Openssh server

edited /etc/hosts
1 entry for localhost.localdomain localhost
1 entry for server.domain.com server
1 entry for mail.domain.com mail (added as sub-domain in DNS)



edited /etc/network/interfaces
eth0 for server
eth0:0 for mail

restarted network
/etc/init.d/networking restart

did:
ifconfig (made sure virtual interface was running)


reset the hostname:
echo server.domain.com > /etc/hostname
/etc/init.d/hostname.sh start

hostname
hostname -f


edited /etc/apt/sources.list
commented out the "deb: cdrom" line

did:
apt-get update
apt-get upgrade



Changed quota size to 25 MB

CREATE TABLE users (
email varchar(80) NOT NULL,
password varchar(20) NOT NULL,
quota INT(10) DEFAULT '10485760',
PRIMARY KEY (email)
) TYPE=MyISAM;

to:

CREATE TABLE users (
email varchar(80) NOT NULL,
password varchar(20) NOT NULL,
quota INT(10) DEFAULT '26214400',
PRIMARY KEY (email)
) TYPE=MyISAM;


Changed:
apt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 unzoo libnet-ph-perl libnet-snpp-perl libnet-telnet-perl nomarch lzop pax

to:
apt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 unzoo libnet-ph-perl libnet-snpp-perl libnet-telnet-perl nomarch lzop pax lha arj unrar cabextract



Changed for 25 MB quota:
INSERT INTO `users` (`email`, `password`, `quota`) VALUES ('sales@example.com', ENCRYPT('secret'), 10485760);

to:
INSERT INTO `users` (`email`, `password`, `quota`) VALUES ('sales@example.com', ENCRYPT('secret'), 26214400);



created user1, user2, user3, user4, and postmaster in mail database

sent differnt sized messages to each user

did:
cd /home/vmail/domain.com

find user1

find user2

find user3

find user4

no user/maildirsize file appeared for any of the users

did:
/usr/local/sbin/quota_notify


result:

DAILY QUOTA REPORT:

----------------------------------------------
| % USAGE | ACCOUNT NAME |
----------------------------------------------

--
domain


made the "virtual_mailbox_extended = yes" to "virtual_maildir_extended = yes" change in /etc/postfix/main.cf

did:
/etc/init.d/postfix reload

re-sent the emails to the users

re-issued the find command for each user

now user/maildirsize shows up in all the users

did (again):
/usr/local/sbin/quota_notify


result this time

DAILY QUOTA REPORT:

----------------------------------------------
| % USAGE | ACCOUNT NAME |
----------------------------------------------
| 4 | user4@domain.com |
---------------------------------------------
| 3 | user2@domain.com |
---------------------------------------------
| 1 | user1@domain.com |
---------------------------------------------

--
domain


user3 is still under 1% so he is not showing in the report.

Last edited by thecaoticone; 26th January 2008 at 20:37.
Reply With Quote
The Following 2 Users Say Thank You to thecaoticone For This Useful Post:
AbannyvabVask (20th December 2013), feeninuoumn (17th December 2013)
  #8  
Old 23rd April 2008, 05:58
atjensen11 atjensen11 is offline
Senior Member
 
Join Date: Dec 2007
Posts: 199
Thanks: 9
Thanked 6 Times in 6 Posts
Default

I just wanted to say thanks. I too had followed Falko's guide and was wondering why I wasn't receiving the quota information.

I implemented this change in about thiry seconds and was off and running like new.

Thanks to all who make this site as good as it is.
Reply With Quote
  #9  
Old 7th July 2008, 19:53
atjensen11 atjensen11 is offline
Senior Member
 
Join Date: Dec 2007
Posts: 199
Thanks: 9
Thanked 6 Times in 6 Posts
Default

Since my last posting here, I have rebuilt my server using Ubuntu 8.04 LTS. I had completely forgotten about the quota patch I had applied from this thread earlier.

I soon noticed that my daily Quota reports did not seem to be changing and in particular, new users were not showing up in the reports. I checked and the maildirsize files are not be created.

So I applied the patch to the new server and sent some test emails. Again, the maildirsize files were not created. I then created a blank maildirsize file and sent emails to see if the file would be updated. It was not.

So it appears that the patch works in the 7.10 version of Ubuntu, but not the 8.04.

Any suggestions?

Thanks.
Reply With Quote
  #10  
Old 8th July 2008, 13:42
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
 
Default

Have you tried this tutorial? http://www.howtoforge.com/virtual-us...ail-ubuntu8.04
__________________
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
The Following 2 Users Say Thank You to falko For This Useful Post:
AbannyvabVask (20th December 2013), feeninuoumn (24th December 2013)
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
Postfix Quota Notification Email Script asyadiqin Installation/Configuration 14 23rd July 2010 13:35
Postfix Email Delivery Problem sedat1903 HOWTO-Related Questions 2 22nd December 2008 11:19
postfix myysql quota 40esp Server Operation 9 26th July 2008 11:33
Centos 4.4 32bit Hangs, High Server load 3cwired_com Server Operation 11 16th November 2006 15:47
Verify email setup meekish Installation/Configuration 28 27th October 2006 15:36


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


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