Added support for imap-ssl for the gui import

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO
2022-04-18 12:59:53 +02:00
parent 828964ec4c
commit a31f5b7a26
2 changed files with 9 additions and 6 deletions

View File

@ -48,11 +48,15 @@ class ControllerImportTest extends Controller {
}
else if($this->request->post['type'] == 'imap') {
else if($this->request->post['type'] == 'imap' || $this->request->post['type'] == 'imap-ssl') {
$ssl = false;
if($this->request->post['type'] == 'imap-ssl') {
$ssl = 'SSL';
}
try {
$conn = new Zend_Mail_Protocol_Imap($this->request->post['server'], '143', false);
$conn = new Zend_Mail_Protocol_Imap($this->request->post['server'], null, $ssl);
$login = $conn->login($this->request->post['username'], $this->request->post['password']);
@ -61,7 +65,7 @@ class ControllerImportTest extends Controller {
} else {
print "<span class=\"text-error\">" . $this->request->post['username'] . ": " . $lang->data['text_login_failed'] . "</span> ";
}
} catch (Zend_Mail_Protocol_Exception $e) {
print "<span class=\"text-error\">" . $this->request->post['server'] . ": " . $lang->data['text_connection_failed'] . "</span> ";
}
@ -76,5 +80,3 @@ class ControllerImportTest extends Controller {
}
?>