- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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
45 class GSmtp::ProtocolMessageStore : public GSmtp::ProtocolMessage
46 {
47 public:
48 ProtocolMessageStore( MessageStore & store , std::auto_ptr<Processor> ) ;
50
51 virtual ~ProtocolMessageStore() ;
53
54 virtual G::Signal3<bool,unsigned long,std::string> & doneSignal() ;
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 ;
91 G::Signal3<bool,unsigned long,std::string> m_done_signal ;
92 } ;
93
94 #endif
95
GSmtp
SMTP and message-store classes.
GSmtp::ProtocolMessageStore::addReceived
virtual void addReceived(const std::string &)
Final override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:98
GSmtp::ProtocolMessageStore::clear
virtual void clear()
Final override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:48
gprotocolmessage.h
GSmtp::ProtocolMessageStore::addText
virtual bool addText(const std::string &)
Final override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:104
gslot.h
GSmtp::ProtocolMessageStore::from
virtual std::string from() const
Final override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:112
GSmtp::ProtocolMessageStore
A concrete implementation of the ProtocolMessage interface that stores incoming messages in the messa...
Definition: gprotocolmessagestore.h:45
GSmtp::ProtocolMessageStore::setFrom
virtual bool setFrom(const std::string &from_user)
Final override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:56
GSmtp::ProtocolMessageStore::process
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.
Definition: gprotocolmessagestore.cpp:117
GSmtp::ProtocolMessageStore::ProtocolMessageStore
ProtocolMessageStore(MessageStore &store, std::auto_ptr< Processor >)
Constructor.
Definition: gprotocolmessagestore.cpp:30
GSmtp::MessageStore
A class which allows SMTP messages (envelope+content) to be stored and retrieved. ...
Definition: gmessagestore.h:45
GSmtp::ProtocolMessageStore::reset
virtual void reset()
Final override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:42
GSmtp::ProtocolMessageStore::~ProtocolMessageStore
virtual ~ProtocolMessageStore()
Destructor.
Definition: gprotocolmessagestore.cpp:37
gmessagestore.h
GSmtp::ProtocolMessageStore::doneSignal
virtual G::Signal3< bool, unsigned long, std::string > & doneSignal()
Final override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:183
G::Signal3< bool, unsigned long, std::string >
GSmtp::VerifierStatus
A structure returned by GSmtp::Verifier to describe the status of a rcpt-to recipient.
Definition: gverifierstatus.h:51
GSmtp::ProtocolMessage
An interface used by the ServerProtocol class to assemble and process an incoming message...
Definition: gprotocolmessage.h:64
gprocessor.h
gsmtp.h
gnewmessage.h
GSmtp::ProtocolMessageStore::addTo
virtual bool addTo(const std::string &to_user, VerifierStatus to_status)
Final override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:73