View Single Post
  #2  
Old 25th May 2012, 07:30
local.host local.host is offline
Junior Member
 
Join Date: Feb 2012
Location: Australia
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Solution Working!!!!

Hi everyone,

With some great advise from Till and some minor tweaking I have this working.

Step 1) Update the control panel to ISPConfig 3.0.4.5 as this has a 'resync' option in 'Tools > Sync Tools > Resync' which allows for resyncing of items.

Unfortunately there is a minor bug in the resyncing of mail.
  • Doesn't sync mail domains - only mailboxes
  • mailbox sql statement has an error

Step 2) edit the resync.php file (on my Centos 6.2 machine it's located in /usr/local/ispconfig/interface/web/tools)

Add the following "BEFORE" the //* Resyncing Mailboxes section

PHP Code:
//* Resyncing Mailbox Domains
if(isset($_POST['resync_mailbox']) && $_POST['resync_mailbox'] == 1) {
    
$db_table 'mail_domain';
    
$index_field 'domain_id';
    
$sql "SELECT * FROM ".$db_table." WHERE active = 'y'";
    
$records $app->db->queryAllRecords($sql);
    if(
is_array($records)) {
        foreach(
$records as $rec) {
            
$app->db->datalogUpdate($db_table$rec$index_field$rec[$index_field], true);
            
$msg .= "Resynced Mail Domain: ".$rec['domain'].'<br />';
        }
    }

Under the //* Resyncing Mailboxes section change:

PHP Code:
$sql "SELECT * FROM ".$db_table." WHERE active = 'y'"
To

PHP Code:
$sql "SELECT * FROM ".$db_table.""
Step 3) Run the resync tool and you should see the tasks appear in the jobqueue.

regards

Aaron.
Reply With Quote