POP3 messages collection.
Exemple #1
0
        /// <summary>
        /// Gest pop3 messages info.
        /// </summary>
        /// <param name="session"></param>
        /// <param name="messages"></param>
        internal virtual void OnGetMessagesInfo(POP3_Session session, POP3_Messages messages)
        {
            GetMessagesInfo_EventArgs oArg = new GetMessagesInfo_EventArgs(session, messages, session.UserName);

            if (this.GetMessgesList != null)
            {
                this.GetMessgesList(this, oArg);
            }
        }
        private string m_UserName = ""; // Holds loggedIn UserName.

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="clientSocket">Referance to socket.</param>
        /// <param name="server">Referance to POP3 server.</param>
        /// <param name="sessionID">Session ID which is assigned to this session.</param>
        /// <param name="logWriter">Log writer.</param>
        public POP3_Session(Socket clientSocket,POP3_Server server,string sessionID,_LogWriter logWriter)
        {
            m_pClientSocket    = clientSocket;
            m_pPOP3_Server     = server;
            m_SessionID        = sessionID;
            m_POP3_Messages    = new POP3_Messages();
            m_pLogWriter       = logWriter;
            m_SessionStartTime = DateTime.Now;
        }
Exemple #3
0
        private string m_UserName = ""; // Holds loggedIn UserName.

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="clientSocket">Referance to socket.</param>
        /// <param name="server">Referance to POP3 server.</param>
        /// <param name="logWriter">Log writer.</param>
        public POP3_Session(Socket clientSocket,POP3_Server server,_LogWriter logWriter)
        {
            m_pSocket    = new BufferedSocket(clientSocket);
            m_pServer    = server;
            m_pLogWriter = logWriter;

            m_SessionID        = Guid.NewGuid().ToString();
            m_POP3_Messages    = new POP3_Messages();
            m_SessionStartTime = DateTime.Now;
            m_LastDataTime     = DateTime.Now;

            m_pSocket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.NoDelay,1);

            // Start session proccessing
            StartSession();
        }
Exemple #4
0
        private string m_UserName = ""; // Holds loggedIn UserName.

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="clientSocket">Referance to socket.</param>
        /// <param name="server">Referance to POP3 server.</param>
        /// <param name="logWriter">Log writer.</param>
        public POP3_Session(Socket clientSocket,POP3_Server server,SocketLogger logWriter)
        {
            m_pSocket = new BufferedSocket(clientSocket);
            m_pServer = server;

            m_SessionID        = Guid.NewGuid().ToString();
            m_POP3_Messages    = new POP3_Messages();
            m_SessionStartTime = DateTime.Now;
            m_LastDataTime     = DateTime.Now;

            if(m_pServer.LogCommands){
                m_pSocket.Logger = logWriter;
                m_pSocket.Logger.SessionID = m_SessionID;
            }

            m_pSocket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.NoDelay,1);
            m_pSocket.Activity += new EventHandler(OnSocketActivity);

            // Start session proccessing
            StartSession();
        }
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to pop3 session.</param>
 /// <param name="messages"></param>
 /// <param name="mailbox">Mailbox name.</param>
 public GetMessagesInfo_EventArgs(POP3_Session session,POP3_Messages messages,string mailbox)
 {
     m_pSession       = session;
     m_pPOP3_Messages = messages;
     m_UserName       = mailbox;
 }
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="messages"></param>
 public POP3_Message(POP3_Messages messages)
 {
     m_pMessages = messages;
 }
Exemple #7
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to pop3 session.</param>
 /// <param name="messages"></param>
 /// <param name="mailbox">Mailbox name.</param>
 public GetMessagesInfo_EventArgs(POP3_Session session, POP3_Messages messages, string mailbox)
 {
     m_pSession       = session;
     m_pPOP3_Messages = messages;
     m_UserName       = mailbox;
 }
Exemple #8
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="messages"></param>
 public POP3_Message(POP3_Messages messages)
 {
     m_pMessages = messages;
 }