@@ -1236,14 +1236,10 @@ protected function output() {
12361236 }
12371237 $ default_behaviour_html .= '<button class="submit_default_behavior btn btn-primary"> ' . $ this ->trans ('Submit ' ) . '</button></div></div> ' ;
12381238 $ client = SieveConnectionPool::get ($ mailbox ['id ' ]);
1239- // $current_script = SieveConnectionPool::getScript($mailbox['id'], 'blocked_senders');
12401239 $ current_script = SieveConnectionPool::getScript ($ mailbox ['id ' ], 'blocked_senders ' );
1241- // $client->getScript('blocked_senders');
12421240 $ scripts = $ client ->listScripts ();
1243- exit (var_dump ($ scripts , $ current_script ));//SieveConnectionPool::get($imapServer);
12441241 list ($ scripts , $ current_script ) = get_all_scripts ($ mailbox ['id ' ], true );
12451242 $ blocked_senders = get_blocked_senders_array ($ current_script , $ scripts );
1246- exit (var_dump ($ blocked_senders ));
12471243 $ num_blocked = $ blocked_senders ? sizeof ($ blocked_senders ) : 0 ;
12481244 $ res = '<div class="sievefilters_accounts_item"> ' ;
12491245 $ 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 ' ];
@@ -1466,7 +1462,7 @@ public function process() {
14661462 }
14671463
14681464 try {
1469- $ current_script = get_all_scripts ($ this -> config , $ this -> user_config , $ imap_account , true , ' current_script ' );
1465+ list ( $ scripts , $ current_script) = get_all_scripts ($ form [ ' imap_server_id ' ], true );
14701466
14711467 $ blocked_senders = [];
14721468 if ($ current_script != '' ) {
@@ -1551,6 +1547,7 @@ public function process()
15511547 }
15521548 // set the sieve connection pool with the sieve accounts configs
15531549 if (!empty ($ sieve_accounts_configs )) {
1550+ SieveConnectionPool::setCache ($ this ->cache );
15541551 SieveConnectionPool::setConfig ($ sieve_accounts_configs );
15551552 }
15561553 if (isset ($ accounts [$ form ['imap_server_id ' ]])) {
@@ -1574,7 +1571,8 @@ public function process()
15741571
15751572 $ mailbox = Hm_IMAP_List::get_connected_mailbox ($ form ['imap_server_id ' ], $ this ->cache );
15761573 if ($ mailbox && $ mailbox ->authed () && $ mailbox ->is_imap ()) {
1577- list ($ scripts , $ current_script , $ client ) = get_all_scripts ($ this ->config , $ this ->user_config , $ mailbox , true );
1574+ // list($scripts, $current_script, $client) = get_all_scripts($this->config, $this->user_config, $mailbox, true);
1575+ list ($ scripts , $ current_script ) = get_all_scripts ($ form ['imap_server_id ' ], true );
15781576 $ linked_mailboxes = get_sieve_linked_mailbox ($ scripts , $ current_script );
15791577 if ($ linked_mailboxes && in_array ($ form ['folder ' ], $ linked_mailboxes )) {
15801578 try {
@@ -1623,7 +1621,9 @@ public function process()
16231621 $ mailbox = Hm_IMAP_List::get_connected_mailbox ($ form ['imap_server_id ' ], $ this ->cache );
16241622 if ($ mailbox && $ mailbox ->authed () && $ mailbox ->is_imap ()) {
16251623 $ del_folder = prep_folder_name ($ mailbox ->get_connection (), $ form ['folder ' ], true );
1626- list ($ scripts , $ current_script , $ client ) = get_all_scripts ($ this ->config , $ this ->user_config , $ mailbox );
1624+ $ client = SieveConnectionPool::get ($ mailbox ['id ' ]);
1625+ // list($scripts, $current_script, $client) = get_all_scripts($this->config, $this->user_config, $mailbox);
1626+ list ($ scripts ) = get_all_scripts ($ form ['imap_server_id ' ], false );
16271627 if (is_mailbox_linked_with_filters ($ del_folder , $ form ['imap_server_id ' ], $ this , $ scripts , $ client )) {
16281628 $ this ->out ('sieve_can_delete_folder ' , false );
16291629 Hm_Msgs::add ('This folder can \'t be deleted because it is used in a Sieve filter. ' , 'warning ' );
0 commit comments