/** * @param string $sServerName * @param int $iPort = 106 * @param int $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT * @param bool $bVerifySsl = false * @param bool $bAllowSelfSigned = true * * @return \MailSo\Poppassd\PoppassdClient * * @throws \MailSo\Base\Exceptions\InvalidArgumentException * @throws \MailSo\Net\Exceptions\Exception * @throws \MailSo\Poppassd\Exceptions\ResponseException */ public function Connect($sServerName, $iPort = 106, $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT, $bVerifySsl = false, $bAllowSelfSigned = true) { $this->iRequestTime = \microtime(true); parent::Connect($sServerName, $iPort, $iSecurityType, $bVerifySsl, $bAllowSelfSigned); $this->validateResponse(); return $this; }
/** * @param string $sServerName * @param int $iPort = 106 * @param int $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT * * @return \MailSo\Poppassd\PoppassdClient * * @throws \MailSo\Base\Exceptions\InvalidArgumentException * @throws \MailSo\Net\Exceptions\Exception * @throws \MailSo\Poppassd\Exceptions\ResponseException */ public function Connect($sServerName, $iPort = 106, $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT) { $this->iRequestTime = \microtime(true); parent::Connect($sServerName, $iPort, $iSecurityType); $this->validateResponse(); return $this; }
/** * @param string $sServerName * @param int $iPort = 110 * @param int $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT * @param bool $bVerifySsl = false * * @return \MailSo\Pop3\Pop3Client * * @throws \MailSo\Base\Exceptions\InvalidArgumentException * @throws \MailSo\Net\Exceptions\Exception * @throws \MailSo\Pop3\Exceptions\ResponseException */ public function Connect($sServerName, $iPort = 110, $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT, $bVerifySsl = false) { $this->iRequestTime = microtime(true); parent::Connect($sServerName, $iPort, $iSecurityType, $bVerifySsl); $this->validateResponse(); if (\MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS(in_array('STLS', $this->Capa()), $this->iSecurityType)) { $this->sendRequestWithCheck('STLS'); $this->EnableCrypto(); $this->aCapa = null; } else { if (\MailSo\Net\Enumerations\ConnectionSecurityType::STARTTLS === $this->iSecurityType) { $this->writeLogException(new \MailSo\Net\Exceptions\SocketUnsuppoterdSecureConnectionException('STARTTLS is not supported'), \MailSo\Log\Enumerations\Type::ERROR, true); } } return $this; }
/** * @param string $sServerName * @param int $iPort = 110 * @param int $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT * * @return \MailSo\Pop3\Pop3Client * * @throws \MailSo\Base\Exceptions\InvalidArgumentException * @throws \MailSo\Net\Exceptions\Exception * @throws \MailSo\Pop3\Exceptions\ResponseException */ public function Connect($sServerName, $iPort = 110, $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT) { $this->iRequestTime = microtime(true); parent::Connect($sServerName, $iPort, $iSecurityType); $this->validateResponse(); if (\MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS(in_array('STLS', $this->Capa()), $this->iSecurityType)) { $this->sendRequestWithCheck('STLS'); if (!@stream_socket_enable_crypto($this->rConnect, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { $this->writeLogException(new \MailSo\Pop3\Exceptions\RuntimeException('Cannot enable STARTTLS'), \MailSo\Log\Enumerations\Type::ERROR, true); } $this->aCapa = null; } else { if (\MailSo\Net\Enumerations\ConnectionSecurityType::STARTTLS === $this->iSecurityType) { $this->writeLogException(new \MailSo\Net\Exceptions\SocketUnsuppoterdSecureConnectionException('STARTTLS is not supported'), \MailSo\Log\Enumerations\Type::ERROR, true); } } return $this; }
/** * @param string $sServerName * @param int $iPort = 143 * @param int $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT * @param bool $bVerifySsl = false * @param bool $bAllowSelfSigned = true * * @return \MailSo\Imap\ImapClient * * @throws \MailSo\Base\Exceptions\InvalidArgumentException * @throws \MailSo\Net\Exceptions\Exception * @throws \MailSo\Imap\Exceptions\Exception */ public function Connect($sServerName, $iPort = 143, $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT, $bVerifySsl = false, $bAllowSelfSigned = true) { $this->aTagTimeouts['*'] = \microtime(true); parent::Connect($sServerName, $iPort, $iSecurityType, $bVerifySsl, $bAllowSelfSigned); $this->parseResponseWithValidation('*', true); if (\MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS($this->IsSupported('STARTTLS'), $this->iSecurityType)) { $this->SendRequestWithCheck('STARTTLS'); $this->EnableCrypto(); $this->aCapabilityItems = null; } else { if (\MailSo\Net\Enumerations\ConnectionSecurityType::STARTTLS === $this->iSecurityType) { $this->writeLogException(new \MailSo\Net\Exceptions\SocketUnsuppoterdSecureConnectionException('STARTTLS is not supported'), \MailSo\Log\Enumerations\Type::ERROR, true); } } return $this; }
/** * @param string $sServerName * @param int $iPort = 143 * @param int $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT * * @return \MailSo\Imap\ImapClient * * @throws \MailSo\Base\Exceptions\InvalidArgumentException * @throws \MailSo\Net\Exceptions\Exception * @throws \MailSo\Imap\Exceptions\Exception */ public function Connect($sServerName, $iPort = 143, $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT) { $this->aTagTimeouts['*'] = \microtime(true); parent::Connect($sServerName, $iPort, $iSecurityType); $this->parseResponseWithValidation('*', true); if (\MailSo\Net\Enumerations\ConnectionSecurityType::UseStartTLS($this->IsSupported('STARTTLS'), $this->iSecurityType)) { $this->SendRequestWithCheck('STARTTLS'); if (!@\stream_socket_enable_crypto($this->rConnect, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { $this->writeLogException(new \MailSo\Imap\Exceptions\RuntimeException('Cannot enable STARTTLS'), \MailSo\Log\Enumerations\Type::ERROR, true); } $this->aCapabilityItems = null; } else { if (\MailSo\Net\Enumerations\ConnectionSecurityType::STARTTLS === $this->iSecurityType) { $this->writeLogException(new \MailSo\Net\Exceptions\SocketUnsuppoterdSecureConnectionException('STARTTLS is not supported'), \MailSo\Log\Enumerations\Type::ERROR, true); } } return $this; }
/** * @param string $sServerName * @param int $iPort = 25 * @param string $sEhloHost = '[127.0.0.1]' * @param int $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT * * @return \MailSo\Smtp\SmtpClient * * @throws \MailSo\Base\Exceptions\InvalidArgumentException * @throws \MailSo\Net\Exceptions\Exception * @throws \MailSo\Smtp\Exceptions\ResponseException */ public function Connect($sServerName, $iPort = 25, $sEhloHost = '[127.0.0.1]', $iSecurityType = \MailSo\Net\Enumerations\ConnectionSecurityType::AUTO_DETECT) { $this->iRequestTime = microtime(true); parent::Connect($sServerName, $iPort, $iSecurityType); $this->validateResponse(220); $this->preLoginStartTLSAndEhloProcess($sEhloHost); return $this; }