gprotocolmessage.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2013 Graeme Walker <graeme_walker@users.sourceforge.net>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
20 
21 #ifndef G_SMTP_PROTOCOL_MESSAGE_H
22 #define G_SMTP_PROTOCOL_MESSAGE_H
23 
24 #include "gdef.h"
25 #include "gsmtp.h"
26 #include "gslot.h"
27 #include "gstrings.h"
28 #include "gverifier.h"
29 #include "gexception.h"
30 #include <string>
31 
33 namespace GSmtp
34 {
35  class ProtocolMessage ;
36 }
37 
65 {
66 public:
67  virtual ~ProtocolMessage() ;
69 
78 
79  virtual void reset() = 0 ;
81 
82  virtual void clear() = 0 ;
85 
86  virtual bool setFrom( const std::string & from_user ) = 0 ;
89 
90  virtual bool addTo( const std::string & to_user , VerifierStatus to_status ) = 0 ;
99 
100  virtual void addReceived( const std::string & ) = 0 ;
105 
106  virtual bool addText( const std::string & ) = 0 ;
111 
112  virtual std::string from() const = 0 ;
114 
115  virtual void process( const std::string & authenticated_client_id , const std::string & peer_socket_address ,
116  const std::string & peer_socket_name , const std::string & peer_certificate ) = 0 ;
128 
129 private:
130  void operator=( const ProtocolMessage & ) ; // not implemented
131 } ;
132 
133 #endif
134 
SMTP and message-store classes.
virtual void clear()=0
Clears the message state and terminates any asynchronous message processing.
virtual bool addText(const std::string &)=0
Adds text.
virtual void process(const std::string &authenticated_client_id, const std::string &peer_socket_address, const std::string &peer_socket_name, const std::string &peer_certificate)=0
Starts asynchronous processing of the message.
virtual bool setFrom(const std::string &from_user)=0
Sets the message envelope 'from'.
virtual G::Signal3< bool, unsigned long, std::string > & doneSignal()=0
Returns a signal which is raised once process() has completed.
virtual void addReceived(const std::string &)=0
Adds a 'received' line to the start of the content.
A structure returned by GSmtp::Verifier to describe the status of a rcpt-to recipient.
An interface used by the ServerProtocol class to assemble and process an incoming message...
virtual void reset()=0
Resets the object state as if just constructed.
virtual bool addTo(const std::string &to_user, VerifierStatus to_status)=0
Adds an envelope 'to'.
virtual std::string from() const =0
Returns the setFrom() string.
virtual ~ProtocolMessage()
Destructor.