diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index e690c8839e3..f6146cb409b 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -435,6 +435,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { print $e->getMessage(); } + + $morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver); } else { diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index f2750f7e042..55b6907f912 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -667,16 +667,20 @@ class EmailCollector extends CommonObject /** * Return the connectstring to use with IMAP connection function * + * @param int $norsh Add /norsh to connectstring * @return string */ - public function getConnectStringIMAP() + public function getConnectStringIMAP($ssl = 1, $norsh = 0) { + global $conf; + // Connect to IMAP $flags = '/service=imap'; // IMAP - $flags .= '/ssl'; // '/tls' + if ($ssl) $flags .= '/ssl'; // '/tls' $flags .= '/novalidate-cert'; //$flags.='/readonly'; //$flags.='/debug'; + if ($norsh || ! empty($conf->global->IMPA_FORCE_NORSH)) $flags .= '/norsh'; $connectstringserver = '{'.$this->host.':993'.$flags.'}';