PDA

View Full Version : How to build an email alert notification when a customer is using all his quota space


voltron81
8th September 2009, 19:15
Hello to everybody,
I'm realizing a mail server with ISPConfig 3 and Roundcube.

I would like to realize an "email alert notification" to send to a customer that is using almost all his email space.

Do you have some idea how to realize it?

Thanks

Michele

voltron81
9th September 2009, 19:29
I've found a script that check the quota of each email and, if it's more that 90%, it will send an email to me and the customer.

But I think that having this funcion integrated in ISPConfig could be just great...

Any idea?

Thanks
Michele

voltron81
15th September 2009, 19:39
I was studing a bit the problem, and I realized that into the dbispconfig database there is a table names mail_user, where there is a quota field.

So I think that the logic way to solve the problem is realize a script that check that quota field for every email and, when this quota is 80% that the space assigned to the customers, just send an email to them saying that the space is almost finished.
Do you think it is difficult to realize?
Any idea?

Thanks
Michele

falko
16th September 2009, 14:55
Should not be too difficult if you use a scripting language like PHP. :)

voltron81
16th September 2009, 15:32
Yes, I'm trying to write a PHP script.
I'm with manuals and books studying what I've to do :o

Basically I've integrated a slider into Roundcube. This slider have 11 steps.
With ISPConfig I've created 11 spam policy, I now the policy_id of that policy.

So now what I want to do is connect PHP with MySQL, so that I could realize something like that:
$db_host = "localhost";
$db_user = "root";
$db_password = "password";
$db_name = "dbispconfig";
$db = mysql_connect($db_host, $db_user, $db_password);

if ($db == FALSE)
die ("Communication error. Please check the parameters of the connection to the mysql database");

mysql_select_db($db_name, $db)
or die ("Communication error. Please check the parameters of the connection to the mysql database");

mysql_query("UPDATE spamfilter_users SET policy_id = '$VALUE_SPAM' WHERE email = '$ROUNDCUBE_USER'");
//where $VALUE_SPAM is the value of the spam policy releated with the slider level

mysql_close($db);


$out .= "</table>";

return $out;


At the moment I've 2 problems:
1) I don't know where to find the $ROUNDCUBE_USER, means the email of the user that at that time is using roundcube
2)I don't know where this slider is setting his variables releated with the status (0-10)

Suggestions?

mixo
19th November 2009, 11:30
Hello,
I've ISPConfig 2 and want the same feature.Inform users with mail, when quota is more then 90%.

Has anybody made such a script?

damir
19th November 2009, 11:47
This is something i would look to have integrated in ispconfig so im following your adventure voltron81 :)