diff --git a/phpgwapi/inc/class.auth_mail.inc.php b/phpgwapi/inc/class.auth_mail.inc.php index 492b4c3364..62d79b4d82 100644 --- a/phpgwapi/inc/class.auth_mail.inc.php +++ b/phpgwapi/inc/class.auth_mail.inc.php @@ -43,11 +43,31 @@ { $GLOBALS['phpgw_info']['server']['mail_port'] = '110'; } + elseif ($GLOBALS['phpgw_info']['server']['mail_server_type']=='imaps') + { + $GLOBALS['phpgw_info']['server']['mail_port'] = '993'; + } + elseif ($GLOBALS['phpgw_info']['server']['mail_server_type']=='pop3s') + { + $GLOBALS['phpgw_info']['server']['mail_port'] = '995'; + } if( $GLOBALS['phpgw_info']['server']['mail_server_type']=='pop3') { $mailauth = imap_open('{'.$GLOBALS['phpgw_info']['server']['mail_server'].'/pop3' .':'.$GLOBALS['phpgw_info']['server']['mail_port'].'}INBOX', $username , $passwd); + } + elseif ( $GLOBALS['phpgw_info']['server']['mail_server_type']=='imaps' ) + { + // IMAPS support: + $mailauth = imap_open('{'.$GLOBALS['phpgw_info']['server']['mail_server']."/ssl/novalidate-cert" + .':993}INBOX', $username , $passwd); + } + elseif ( $GLOBALS['phpgw_info']['server']['mail_server_type']=='pop3s' ) + { + // POP3S support: + $mailauth = imap_open('{'.$GLOBALS['phpgw_info']['server']['mail_server']."/ssl/novalidate-cert" + .':995}INBOX', $username , $passwd); } else { diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index 782f2168e8..8a27411c8e 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -1863,6 +1863,14 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info' { $prefs['email']['mail_port'] = '110'; } + elseif ($prefs['email']['mail_server_type']=='imaps') + { + $prefs['email']['mail_port'] = '993'; + } + elseif ($prefs['email']['mail_server_type']=='pop3s') + { + $prefs['email']['mail_port'] = '995'; + } // This is going to be used to switch to the nntp class if (isset($GLOBALS['phpgw_info']['flags']['newsmode']) && $GLOBALS['phpgw_info']['flags']['newsmode'])