View Full Version : Cron to notify email user of mailbox over-limit
DogAndPony
05-17-2005, 01:55 PM
Hey, kids!
I could have sworn there was a thread on this, but my searches are coming up fruitless (Pansy... I must have FRUIT! (http://www.alicia-logic.com/dflysounds/tb_MustHaveFruit.ram) [.ram]).
I need to be able to notify individual users when they're over (or near) their email quota limits.
There's a thread here:
http://www.aota.net/forums/showthread.php?t=16296
...which starts to deal with it, but peters out.
The issues are: 1) Calculating the disk space accurately, including accounting for stats and MySQL data (use of du, vdu, which directories?), 2) determining which mailbox is over their individual limits (are the soft/hard quota filter settings and "included with account" quota shown in the CNC accessible to a script, or would I need to hard-code those?), and 3) sending a warning message to only that mailbox.
Does anyone have a complete cron-based script for the task?
I have one client who regularly gets large photo attachments as part of her work, and she rarely remembers to clean out her IMAP-based email account. I'd like to avoid havig to upgrade for more disk space (which she would probably eventually fill anyway).
Alternately, I could do a script that sends a message to everyone on that package, but it would be really confusing (and annoying) for those who get less email.
One other thing... Optimally, I'd like to set this up so that the client gets the email and cleans up their mess before I even get an account-based warning from FQ.
How often does FQ check for overages and send out notices? Once every day? At what time? (I got a notice generated at 13:30:00 -0000.) Or are the notices sent as the disk fills?
If I can set the script to run, say, 10 hours in advance of FQ's cron (or sometime during the client's business day), I might avoid the FQ notice and the need for me to follow up with the client.
On the other hand, I could just code it so that they get a warning nMB before their limit...
Thanks!
How often does FQ check for overages and send out notices? Once every day? At what time? (I got a notice generated at 13:30:00 -0000.) Or are the notices sent as the disk fills?
I can't say there is a specific time of day but they are looked at on a daily basis. Daily disk space reports are generated by the servers and sent to the FutureQuest team nightly. These report all packages that are using more than their package allowance at the time the report is run.
These are but one way we track this. There are other reports at different time frames that may cause us to take a look. It is also possible that as a result of an unrelated look at a package we may discover a disk space overage. All reports received of disk space overage are verified by a human before any Notice is sent... Well a Human when i am not the one looking
I can assure you that if a Disk Space Warning or Violation is sent the package in question was over their allocation at the time the Notice was sent. So if your account happened to be 20 MB over the package allocation at the time of the nightly report but is no longer over when we look at the report then no notice would be sent.
This assumes that a certain package doesn't over utilize their disk space on a nightly basis and try to reduce the usage before we notice, if a pattern is noticed we would contact the site owner in those cases as well...
-Bob The other one ;)
DogAndPony
05-17-2005, 03:33 PM
Hi, Bob! :ythiya:
I can't say there is a specific time of day but they are looked at on a daily basis...Gotcha...So if your account happened to be 20 MB over the package allocation at the time of the nightly report but is no longer over when we look at the report then no notice would be sent.Groovy...This assumes that a certain package doesn't over utilize their disk space on a nightly basis and try to reduce the usage before we notice, if a pattern is noticed we would contact the site owner in those cases as well...Understandable. That's not the case here, but that's good to know.
Ya know what would be really swank? The option to send a policy letter to the user when you change their limit settings in the CNC. Maybe even with a template that we create so the style and tone are ours.
I know that would be an invisibly-low priority for you guys... Would it be possible for me to do this by creating my own front-end that overlays that screen in the CNC? In other words, will the CNC accept input from a script other than emailmgr.cgi? It'd be nice to be able to do stuff like this in various parts of the CNC, like SA...
-Bob The other one ;)
...Bob (no, I'm the other one!) West
If you are the Other One what does that make me... The Other - Other One? :P
Seriously... We have taken note of the WIBNI (wouldn't it be nice if), however at the present time there are no plans on adding this type of functionality to the CNC. Not saying never but not in the immediate future that is pretty certain ;)
I would recommend looking at some sort of templatable mail form script for this. A favorite of mine, and one I use daily both at work and on my accounts is written by our very own Sheila... Gypsymail, http://www.thinkspot.net/sheila/staticpages/index.php?page=gypsymail
My name is Bob and I am The Other One :yeah:
DogAndPony
05-18-2005, 03:28 PM
If you are the Other One what does that make me... The Other - Other One? :PI could have sworn that I was The Other One! Now I'm having an identity crisis!!
Seriously... We have taken note of the WIBNI (wouldn't it be nice if), however at the present time there are no plans on adding this type of functionality to the CNC. Not saying never but not in the immediate future that is pretty certain ;)Thanks for the WIBNI note-taking! :)I would recommend looking at some sort of templatable mail form script for this.Yeah, I was thinking about that... But the point was to avoid having to enter the same info twice. Thanks for the link (and thanks, Sheila!).
So is there no way to send info to the CNC using my own CGI?
...Bob
Bob West
(The Other x10^23)
Randall
05-18-2005, 09:27 PM
Is it just me, or is there an echo in here?
Hi, Hi, Bob! Bob! :ythiya: :ythiya:
Randall
DogAndPony
05-18-2005, 09:45 PM
Is it just me, or is there an echo in here?
Hi, Hi, Bob! Bob! :ythiya: :ythiya:It's another exciting episode of "Duelling Doppelgängers!". :rasberry:
sheila
05-19-2005, 11:47 PM
So is there no way to send info to the CNC using my own CGI?It is possible to send info to the CNC using your own PHP or CGI script. In fact, it's been done and someone has posted about it here. If I can find the link to that post, I will post it later...
The person who has posted about it has not, however, made their code public. They sell it, so...
Not sure there are any public tips on how to do it, but it is a general technique of sending requests via script to any URL. It's not something that would be specific to the CNC.
Now getting data OUT of the CNC would be much harder than sending info into it, since you would have to parse web pages and pull out only the info that you wanted. It's possible too....just more annoying.
DogAndPony
05-20-2005, 12:30 AM
If I can find the link to that post, I will post it later...Thanks!Not sure there are any public tips on how to do it, but it is a general technique of sending requests via script to any URL. It's not something that would be specific to the CNC.Yeah... I was also thinking along the lines of "is it allowed". I thought maybe there could be some security issue. But I suppose as long as the login is valid......you would have to parse web pages and pull out only the info that you wanted. It's possible too....just more annoying.Heh! Yeah... I've seen it done, in CPShop for Cafe Press, which I've hacked a little for one of my shops.
Well, looks like I've got my work cut out for me...
Thanks!
sheila
05-20-2005, 12:57 AM
Bob, there certainly could be security issues. Not only are there security issues with any script (CGI or PHP) that runs on the servers, but a script that interfaced with the CNC would require your username and password. So there is certainly a risk there.
But it is "allowed". If someone is unfortunate enough to have their account compromised, we disable it, perform an investigation, and then reset the site to "brand new" status (this does not include resetting the email or MySQL...just the web site portion). Obviously, no one wants to go through that. So it is important to take utmost care in operating scripts on one's site.
The best I've been able to turn up tonight in regards to the previous "mentions" of this type of thing are the following...
This is the forum member who has discussed it:
http://www.aota.net/forums/member.php?u=1365
He's mentioned it in at least these two places:
http://www.aota.net/forums/showthread.php?postid=96641#post96641
http://www.aota.net/forums/showthread.php?postid=126913#post126913
His posts are not in the vein of "how to", but more in the "here's a service that is available to you..."
I was sure there was at least one other post where he discussed it in more detail, but perhaps I'm remembering incorrectly, because I can't seem to find it.
DogAndPony
05-20-2005, 01:16 AM
Bob, there certainly could be security issues.
... So it is important to take utmost care in operating scripts on one's site.You really *are* serious, aren't you? :rasberry:
It's a given that care has to be taken in handling login info (and I'd be password-protecting my form as well, so that's a second layer). What I meant was that I thought maybe FQ might have some sort of referer block set up to keep anyone from using an external script to access the CNC.The best I've been able to turn up tonight in regards to the previous "mentions" of this type of thing are the following...Thanks for the links! :yeah:
jr_citizen
05-30-2005, 06:27 PM
I'm a late-joiner of this thread (and not named Bob :wink: ) but have been looking for the same thing.
Rather than have a CRON job run, what about a pre/post processing script that runs whenever an email comes in that would check the users' available quota limits, and if the available space was within a certain percentage, it would then take another action (send an email to the user/another account, etc).
Unfortunately I'm no coder and this is beyond my capabilities. Any thoughts on how to accomplish this?
Adam
sheila
05-31-2005, 01:55 AM
I would not suggest checking before and after each email is delivered. That has the potential to be excessively resource intensive, depending on the rate at which email is delivered to your mailbox. A cronjob is a MUCH better alternative. Running the cron once an hour should be sufficient, but even if you run it once every 15 or 10 minutes, it is still more server friendly than running it as each email is delivered.
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.