Code Search for Developers
 
 
  

ssl_client.cpp from AlphaMail at Krugle


Show ssl_client.cpp syntax highlighted

#include "SSLClient.h"

bool SSLClient::initialized = false;

using std::cout;
using std::cerr;
using std::string;
using std::endl;

int main()
{
   std::string line;
   try {
      SSLClient client("imap.uoregon.edu", "imaps", "/etc/ssl/certs");

      if(client.hasValidCert()) {
         cout << "imaps.uoregon.edu has a valid certificate." << endl;
      } else {
         cout << "imap.uoregon.edu does not have a trusted cert." << endl;
         cout << "Details: " << client.getCertificateDetails() << endl;
      }

      std::cout << client.getLine();
      client << "1 capability\r\n";
      std::cout << client.getLine();
      client << "2 login tkay " PASSWORD "\r\n";
      std::cout << client.getLine();
      client << "3 select inbox\r\n";
      do {
         line = client.getLine();
         std::cout << line;
      } while(line[0] != '3' && line[0] != ' ');
   } catch(std::exception &e) {
      std::cerr << e.what() << std::endl;
      return 1;
   }
   return 0;
}




See more files for this project here

AlphaMail

AlphaMail is an accelerated web mail interface with a C++ middleware layer that is more effective than an IMAP proxy which is a highly scalable (10k+ users). The interface includes modern features, Section 508 compliance, and universal browser support.

Project homepage: http://sourceforge.net/projects/alphamail
Programming language(s): C++,Java,JavaScript,Perl
License: other

  jcorba/
    IMAPClient.java
    IMAPServer.java
    imap.idl
  Makefile
  cache_entry.cc
  client_socket.cc
  date_time.cc
  imaps_test.cc
  map_test.cc
  mkdir.cc
  mm.cc
  oop.cc
  parse_response.cc
  regex1.cc
  request_processor.cc
  server_socket.cc
  split.cc
  ssl.c
  ssl_client.cpp