Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 6th July 2011, 12:23
warlock warlock is offline
Member
 
Join Date: Nov 2008
Posts: 93
Thanks: 1
Thanked 6 Times in 4 Posts
Default Bulk Mail Quota Update

Hi Guys,

Is there anyway to get ISPConfig to recheck all the quota settings for all users?

Here is what I have done, I have a client who has some 500 mailboxes, original only pop3 account so quota was set to 100MB, more and more of their users are now using IMAP and mobile devices so they are not removing mail from the server thus their mailboxes are filling up and mail is not being delivered.

I have run a SQL UPDATE statement to update all the users for a specific domain to 500MB, but the changes are not applied, They are only applied if I go into each mailbox in ISPC and save.

I take it once you click save ISPC runs a script to update that users quota settings ? Can we not run something that will update all users quota settings ?

Thanks.
Reply With Quote
Sponsored Links
  #2  
Old 6th July 2011, 13:52
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

Do not cahnge settings in ispconfig database directly with sql, as these changes will not get written to the config files and are ignored by the system as they are no valid config transactions. If you want to update a value from a script, use the remote API or the datalogUpdate function from the ISPConfig mysql database connection class.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 6th July 2011, 15:11
warlock warlock is offline
Member
 
Join Date: Nov 2008
Posts: 93
Thanks: 1
Thanked 6 Times in 4 Posts
Default

Cool thanks,

Is there and API doc ?
I see that it's not part of teh official ISPC3 Doc.

Can you explain a little more about datalog update
Reply With Quote
  #4  
Old 6th July 2011, 17:45
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

There is no API doc available, but there are some example files in the ispconfig 3 tar.gz file and some informations about the api in the dev forum.

Quote:
Can you explain a little more about datalog update
Every configuration change that shall be written to disk needs a transaction record in the sys_datalog table and the datalogUpdate function is writing these transaction records and updates also the mysql database table.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 17th August 2011, 09:07
warlock warlock is offline
Member
 
Join Date: Nov 2008
Posts: 93
Thanks: 1
Thanked 6 Times in 4 Posts
Default

I am a real noob when it comes to trying to write these things,
does anyone have a script I can copy and use to achieve this ?
Reply With Quote
  #6  
Old 17th August 2011, 11:28
osterhase osterhase is offline
Member
 
Join Date: Jul 2011
Location: Germany
Posts: 63
Thanks: 6
Thanked 7 Times in 5 Posts
Default

Have a look at this thread - maybe it's a starting point.
Reply With Quote
  #7  
Old 17th August 2011, 12:25
warlock warlock is offline
Member
 
Join Date: Nov 2008
Posts: 93
Thanks: 1
Thanked 6 Times in 4 Posts
Default

Ok so this is what I have done so far, please forgive me I am trying here

Code:
<?php

$username = 'xxx';
$password = 'xxx';

$soap_location = 'http://localhost:8080/remote/index.php';
$soap_uri = 'http://localhost:8080/remote/';


$client = new SoapClient(null, array('location' => $soap_location,
                                     'uri'      => $soap_uri));

try {
	if($session_id = $client->login($username,$password)) {
		echo 'Login sucessful. Session-ID:'.$session_id.'<br />';
	}

	$primary_id = 2;
	$domain_id = $client->mail_user_get($session_id, $primary_id);

		if($client->logout($session_id)) {
		echo 'Logout succesful.<br />';
	}

	
} catch (SoapFault $e) {
	die('SOAP Blad: '.$e->getMessage());
}

?>
I am getting a successful login and logout, But I am not seeing the users details that I am querying,

Also another question how would I pass a parameter to the php script, so lets say I want to query users_id 2, how would this be formed ?
http://www.example.com/get_mail_user.php?primary_id=2

and I assume I comment out this line "$primary_id = 2;"
Reply With Quote
  #8  
Old 17th August 2011, 12:30
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

You dont print the details on the screen, so you dont see them.

change line:

$domain_id = $client->mail_user_get($session_id, $primary_id);

to:

$data = $client->mail_user_get($session_id, $primary_id);
print_r($data);

Quote:
Also another question ho would I pass a prameter to the php script, so lets say I want to query users_id 1, how would this be formed ?
http://www.example.com/get_mail_user.php?primary_id=2

and I assume I commect out this line "$primary_id = 2;"
Replace the line:

$primary_id = 2;

with:

$primary_id = intval($_GET['primary_id']);
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 17th August 2011, 12:39
warlock warlock is offline
Member
 
Join Date: Nov 2008
Posts: 93
Thanks: 1
Thanked 6 Times in 4 Posts
Default

So If I now want to update the user, do I have to insert all the prameters returned, or only those in the mail_user.tform.php

server_id
email
password
name
quota
cc
maildir
hoemdir
uid
gid
postfix
disableimap
disablepop3
Reply With Quote
  #10  
Old 17th August 2011, 12:53
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
 
Default

The easiest way is to use the parameters that the get function returned.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
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
installing squirrelmail on Debian with ispconfig3 saco721 Installation/Configuration 18 1st April 2011 18:57
Email Could not send and receive piseth Installation/Configuration 16 17th July 2010 19:27
Postfix + postfixadmin = SMTP errors... Rashef Server Operation 4 25th June 2009 17:12
localhost postfix/master: fatal: bind 127.0.0.1 port 125: Permission denied g18c Installation/Configuration 4 24th March 2009 18:39
Postfix reject connections gabrix Server Operation 27 25th January 2007 09:37


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


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