@@ -211,10 +211,9 @@ public function process() {
211211 $ imap_account = $ imap_servers [$ form ['imap_server_id ' ]];
212212 $ linked_mailboxes = get_sieve_linked_mailbox ($ imap_account , $ this );
213213 if ($ linked_mailboxes && in_array ($ old_folder , $ linked_mailboxes )) {
214- list ( $ sieve_host , $ sieve_port ) = parse_sieve_config_host ( $ imap_account [ ' sieve_config_host ' ] );
214+ $ factory = get_sieve_client_factory ( $ this -> site_config );
215215 try {
216- $ client = new \PhpSieveManager \ManageSieve \Client ($ sieve_host , $ sieve_port );
217- $ client ->connect ($ imap_account ['user ' ], $ imap_account ['pass ' ], $ imap_account ['sieve_tls ' ], "" , "PLAIN " );
216+ $ client = $ factory ->init ($ this ->user_config , $ imap_account , $ this ->module_is_supported ('nux ' ));
218217 $ script_names = array_filter (
219218 $ linked_mailboxes ,
220219 function ($ value ) use ($ old_folder ) {
@@ -835,14 +834,12 @@ protected function output() {
835834
836835if (!hm_exists ('get_sieve_linked_mailbox ' )) {
837836 function get_sieve_linked_mailbox ($ imap_account , $ module ) {
838- if (!$ module ->module_is_supported ('sievefilters ' ) && $ module ->user_config ->get ('enable_sieve_filter_setting ' , DEFAULT_ENABLE_SIEVE_FILTER )) {
837+ if (! ( $ module ->module_is_supported ('sievefilters ' ) && $ module ->user_config ->get ('enable_sieve_filter_setting ' , DEFAULT_ENABLE_SIEVE_FILTER ) )) {
839838 return ;
840839 }
841- list ($ sieve_host , $ sieve_port ) = parse_sieve_config_host ($ imap_account ['sieve_config_host ' ]);
842- $ client = new \PhpSieveManager \ManageSieve \Client ($ sieve_host , $ sieve_port );
840+ $ factory = get_sieve_client_factory ($ site_config );
843841 try {
844- $ tls = isset ($ imap_account ['sieve_tls ' ]) ? $ imap_account ['sieve_tls ' ] : false ;
845- $ client ->connect ($ imap_account ['user ' ], $ imap_account ['pass ' ], $ tls , "" , "PLAIN " );
842+ $ client = $ factory ->init ($ module ->user_config , $ imap_account , $ module ->module_is_supported ('nux ' ));
846843 $ scripts = $ client ->listScripts ();
847844 $ folders = [];
848845 foreach ($ scripts as $ s ) {
0 commit comments