diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 05f7c5e7656..65df587e299 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1128,6 +1128,8 @@ class EmailCollector extends CommonObject $this->fetchFilters(); $this->fetchActions(); + $targetdir = ($this->target_directory ? $this->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag' + if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) { if ($this->acces_type == 1) { // Mode OAUth2 with PHP-IMAP @@ -1233,7 +1235,6 @@ class EmailCollector extends CommonObject return -2; } $sourcedir = $this->source_directory; - $targetdir = ($this->target_directory ? $this->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag' $connectstringserver = $this->getConnectStringIMAP(); $connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir);