Hi Becki, I have something like this:
SELECT `userid`, `curmail_size`, `maxmail_size`, ((`curmail_size`*100) / `maxmail_size`) `perc` FROM `dbmail_users` WHERE `maxmail_size` > 0 AND (`curmail_size` / `maxmail_size`) > 0.9 Which returns all users that have a max mailsize set and > 90% used, with some other relevant info. Good luck with it! Test thoroughly before using in production! Grtz, Casper On Thu, 2007-11-29 at 18:59 +0700, Administrator Beckspaced.com wrote: > hi casper, > > thanks for your reply not getting the script ;-) > i'm aware that there are other, probably better ways to do this. > > but i didn't want to dig any further into the database stuff ... so i > just used the command line tool provided by dbmail to get the info i wanted. > > i think there are many ways to do this ... my choice probably wasn't the > smartest ... and was coded in a very short time. > > but after all it does its job successfully since a few years. > > by the way ... what query should i use to get the mail box size from the > database? sorry for asking just being terribly lazy ;-) > > all the best & fun > becki > > > Casper Langemeijer wrote: > > Hi Becki, > > > > I don't get your script. If you already have a mysql connection to get > > the mailbox names, why don't you just query the mailboxsize and max > > size from mysql? > > > > Grtz, Casper > > > > > > On Mon, 2007-11-26 at 07:00 +0700, Administrator Beckspaced.com wrote: > >> hello, > >> > >> my name is becki and i'm using dbmail successfully since a couple of years. > >> so really thanks for this nice piece of software which runs stable on my > >> SuSE Linux server 9.3 and 10.2 without any issues so far. > >> > >> just recently i browsed through the mailing list and dbmail wikki to > >> look for news and updates, etc ... > >> then i found a couple of messages regarding the missing mail quota > >> features which i also sort of missed a few times. > >> > >> anyway ... because of that missing feature i programmed a tiny php shell > >> script a while ago. > >> the script runs as a daily cron job and simply browses through every > >> user in the dbmail users table, then runs the 'dbmail-adduser s' command > >> on the CLI and checks the output via a regular expression. if a > >> percentage quota is met then the script sends out a notify to the mail > >> user account. > >> > >> the script is really nothing fancy but does its job pretty well on my > >> suse box since a few years. > >> > >> the script needs PHP >= 4.3.0 > >> and ONLY supports the dbmail branch of 1.2.x > >> on my system it runs stable with dbmail 1.2.12.1 > >> > >> on top of the script there's a config section to setup your mysql info > >> like, user name, password, table, quote percentage, etc ... > >> > >> line 129 - 162 defines the message which will be send to the user and > >> someone is more than welcome to modify this message to their specific need. > >> > >> like i said earlier ... really nothing too fancy ... but it might > >> probably help someone out there! > >> > >> so i would like to contribute this script to the dbmail wikki section if > >> that is okay with you. > >> > >> if you have any questions or whatsoever then please don't hesitate and > >> get in contact with me. > >> > >> thanks a lot for your time & wish you a nice day > >> > >> with best regards > >> becki beckmann > >> > >> > > >
_______________________________________________ DBmail mailing list [email protected] https://mailman.fastxs.nl/mailman/listinfo/dbmail
