gprotocolmessagestore.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_STORE_H
22 #define G_SMTP_PROTOCOL_MESSAGE_STORE_H
23 
24 #include "gdef.h"
25 #include "gsmtp.h"
26 #include "gprotocolmessage.h"
27 #include "gmessagestore.h"
28 #include "gnewmessage.h"
29 #include "gprocessor.h"
30 #include "gslot.h"
31 #include <string>
32 #include <memory>
33 
35 namespace GSmtp
36 {
37  class ProtocolMessageStore ;
38 }
39 
46 {
47 public:
48  ProtocolMessageStore( MessageStore & store , std::auto_ptr<Processor> ) ;
50 
51  virtual ~ProtocolMessageStore() ;
53 
56 
57  virtual void reset() ;
59 
60  virtual void clear() ;
62 
63  virtual bool setFrom( const std::string & from_user ) ;
65 
66  virtual bool addTo( const std::string & to_user , VerifierStatus to_status ) ;
68 
69  virtual void addReceived( const std::string & ) ;
71 
72  virtual bool addText( const std::string & ) ;
74 
75  virtual std::string from() const ;
77 
78  virtual void process( const std::string & auth_id , const std::string & peer_socket_address ,
79  const std::string & peer_socket_name , const std::string & peer_certificate ) ;
81 
82 private:
83  void operator=( const ProtocolMessageStore & ) ; // not implemented
84  void preprocessorDone( bool ) ;
85 
86 private:
87  MessageStore & m_store ;
88  std::auto_ptr<Processor> m_processor ;
89  std::auto_ptr<NewMessage> m_msg ;
90  std::string m_from ;
92 } ;
93 
94 #endif
95 
SMTP and message-store classes.
virtual void addReceived(const std::string &)
Final override from GSmtp::ProtocolMessage.
virtual void clear()
Final override from GSmtp::ProtocolMessage.
virtual bool addText(const std::string &)
Final override from GSmtp::ProtocolMessage.
virtual std::string from() const
Final override from GSmtp::ProtocolMessage.
A concrete implementation of the ProtocolMessage interface that stores incoming messages in the messa...
virtual bool setFrom(const std::string &from_user)
Final override from GSmtp::ProtocolMessage.
virtual void process(const std::string &auth_id, const std::string &peer_socket_address, const std::string &peer_socket_name, const std::string &peer_certificate)
Final override from GSmtp::ProtocolMessage.
ProtocolMessageStore(MessageStore &store, std::auto_ptr< Processor >)
Constructor.
A class which allows SMTP messages (envelope+content) to be stored and retrieved. ...
Definition: gmessagestore.h:45
virtual void reset()
Final override from GSmtp::ProtocolMessage.
virtual ~ProtocolMessageStore()
Destructor.
virtual G::Signal3< bool, unsigned long, std::string > & doneSignal()
Final override from GSmtp::ProtocolMessage.
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 bool addTo(const std::string &to_user, VerifierStatus to_status)
Final override from GSmtp::ProtocolMessage.