コード例 #1
0
   void
   POP3ClientConnection::ParseStateCAPASent_(const String &sData)
   {
      if (!CommandIsSuccessfull_(sData) || !sData.Contains(_T("STLS")))
      {
         // STLS is not supported.
         if (GetConnectionSecurity() == CSSTARTTLSRequired)
         {
            String message = 
               Formatter::Format("The download of messages from external account {0} failed. The external aAccount is configured to use STARTTLS connection security, but the POP3 server does not support it.", account_->GetName());
            
            LOG_APPLICATION(message)
            QuitNow_();
            return;
         }
         else
         {
            SendUserName_();
            return;
         }
      }

      EnqueueWrite_("STLS");
      current_state_ = StateSTLSSent;
   }
コード例 #2
0
 void
 SMTPClientConnection::HandleHandshakeFailed_() 
 {
    if (GetConnectionSecurity() == CSSTARTTLSOptional)
    {
       for(std::shared_ptr<MessageRecipient> recipient : recipients_)
          recipient->SetDeliveryResult(MessageRecipient::ResultOptionalHandshakeFailed);
    }
 }
コード例 #3
0
   void
   SMTPClientConnection::ProtocolStateHELOEHLO_(const AnsiString &request)
   {
      bool use_esmtp  = GetConnectionSecurity() == CSSTARTTLSRequired ||
                        GetConnectionSecurity() == CSSTARTTLSOptional ||
                        use_smtpauth_;

      String computer_name = Utilities::ComputerName(); 

      if (use_esmtp)
      {
         EnqueueWrite_("EHLO " + computer_name);
         SetState_(EHLOSENT);
      }
      else
      {
         EnqueueWrite_("HELO " + computer_name);
         SetState_(HELOSENT);
      }
         
   }
コード例 #4
0
   void
   POP3ClientConnection::ParseStateConnected_(const String &sData)
   {
      if (CommandIsSuccessfull_(sData))
      {
         if (GetConnectionSecurity() == CSSTARTTLSOptional ||
             GetConnectionSecurity() == CSSTARTTLSRequired)
         {
            SendCAPA_();
            return;
         }
         else
         {
            SendUserName_();
            return;
         }
      }

      // Disconnect immediately.;
      QuitNow_();
      return;
   }