@@ -1230,14 +1230,10 @@ protected function output() {
12301230 }
12311231 $ default_behaviour_html .= '<button class="submit_default_behavior btn btn-primary"> ' . $ this ->trans ('Submit ' ) . '</button></div></div> ' ;
12321232 $ client = SieveConnectionPool::get ($ mailbox ['id ' ]);
1233- // $current_script = SieveConnectionPool::getScript($mailbox['id'], 'blocked_senders');
12341233 $ current_script = SieveConnectionPool::getScript ($ mailbox ['id ' ], 'blocked_senders ' );
1235- // $client->getScript('blocked_senders');
12361234 $ scripts = $ client ->listScripts ();
1237- exit (var_dump ($ scripts , $ current_script ));//SieveConnectionPool::get($imapServer);
12381235 list ($ scripts , $ current_script ) = get_all_scripts ($ mailbox ['id ' ], true );
12391236 $ blocked_senders = get_blocked_senders_array ($ current_script , $ scripts );
1240- exit (var_dump ($ blocked_senders ));
12411237 $ num_blocked = $ blocked_senders ? sizeof ($ blocked_senders ) : 0 ;
12421238 $ res = '<div class="sievefilters_accounts_item"> ' ;
12431239 $ res .= '<div class="sievefilters_accounts_title settings_subtitle py-2 border-bottom cursor-pointer d-flex justify-content-between" data-num-blocked=" ' . $ num_blocked . '"> ' . $ mailbox ['name ' ];
@@ -1460,7 +1456,7 @@ public function process() {
14601456 }
14611457
14621458 try {
1463- $ current_script = get_all_scripts ($ this -> config , $ this -> user_config , $ imap_account , true , ' current_script ' );
1459+ list ( $ scripts , $ current_script) = get_all_scripts ($ form [ ' imap_server_id ' ], true );
14641460
14651461 $ blocked_senders = [];
14661462 if ($ current_script != '' ) {
@@ -1545,6 +1541,7 @@ public function process()
15451541 }
15461542 // set the sieve connection pool with the sieve accounts configs
15471543 if (!empty ($ sieve_accounts_configs )) {
1544+ SieveConnectionPool::setCache ($ this ->cache );
15481545 SieveConnectionPool::setConfig ($ sieve_accounts_configs );
15491546 }
15501547 if (isset ($ accounts [$ form ['imap_server_id ' ]])) {
@@ -1568,7 +1565,8 @@ public function process()
15681565
15691566 $ mailbox = Hm_IMAP_List::get_connected_mailbox ($ form ['imap_server_id ' ], $ this ->cache );
15701567 if ($ mailbox && $ mailbox ->authed () && $ mailbox ->is_imap ()) {
1571- list ($ scripts , $ current_script , $ client ) = get_all_scripts ($ this ->config , $ this ->user_config , $ mailbox , true );
1568+ // list($scripts, $current_script, $client) = get_all_scripts($this->config, $this->user_config, $mailbox, true);
1569+ list ($ scripts , $ current_script ) = get_all_scripts ($ form ['imap_server_id ' ], true );
15721570 $ linked_mailboxes = get_sieve_linked_mailbox ($ scripts , $ current_script );
15731571 if ($ linked_mailboxes && in_array ($ form ['folder ' ], $ linked_mailboxes )) {
15741572 try {
@@ -1617,7 +1615,9 @@ public function process()
16171615 $ mailbox = Hm_IMAP_List::get_connected_mailbox ($ form ['imap_server_id ' ], $ this ->cache );
16181616 if ($ mailbox && $ mailbox ->authed () && $ mailbox ->is_imap ()) {
16191617 $ del_folder = prep_folder_name ($ mailbox ->get_connection (), $ form ['folder ' ], true );
1620- list ($ scripts , $ current_script , $ client ) = get_all_scripts ($ this ->config , $ this ->user_config , $ mailbox );
1618+ $ client = SieveConnectionPool::get ($ mailbox ['id ' ]);
1619+ // list($scripts, $current_script, $client) = get_all_scripts($this->config, $this->user_config, $mailbox);
1620+ list ($ scripts ) = get_all_scripts ($ form ['imap_server_id ' ], false );
16211621 if (is_mailbox_linked_with_filters ($ del_folder , $ form ['imap_server_id ' ], $ this , $ scripts , $ client )) {
16221622 $ this ->out ('sieve_can_delete_folder ' , false );
16231623 Hm_Msgs::add ('This folder can \'t be deleted because it is used in a Sieve filter. ' , 'warning ' );
0 commit comments