E-MailRelay

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

gprotocolmessagestore.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2018 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 // ===
17 ///
18 /// \file gprotocolmessagestore.h
19 ///
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 "gfilter.h"
30 #include "gslot.h"
31 #include <string>
32 #include <memory>
33
34 namespace GSmtp
35 {
36 class ProtocolMessageStore ;
37 }
38
39 /// \class GSmtp::ProtocolMessageStore
40 /// A concrete implementation of the ProtocolMessage interface
41 /// that stores incoming messages in the message store.
42 /// \see GSmtp::ProtocolMessageForward
43 ///
44 class GSmtp::ProtocolMessageStore : public ProtocolMessage
45 {
46 public:
47 ProtocolMessageStore( MessageStore & store , unique_ptr<Filter> ) ;
48 ///< Constructor.
49
50 virtual ~ProtocolMessageStore() ;
51 ///< Destructor.
52
53 virtual G::Slot::Signal4<bool,unsigned long,std::string,std::string> & doneSignal() override ;
54 ///< Override from GSmtp::ProtocolMessage.
55
56 virtual void reset() override ;
57 ///< Override from GSmtp::ProtocolMessage.
58
59 virtual void clear() override ;
60 ///< Override from GSmtp::ProtocolMessage.
61
62 virtual bool setFrom( const std::string & from_user , const std::string & ) override ;
63 ///< Override from GSmtp::ProtocolMessage.
64
65 virtual bool addTo( const std::string & to_user , VerifierStatus to_status ) override ;
66 ///< Override from GSmtp::ProtocolMessage.
67
68 virtual void addReceived( const std::string & ) override ;
69 ///< Override from GSmtp::ProtocolMessage.
70
71 virtual bool addText( const char * , size_t ) override ;
72 ///< Override from GSmtp::ProtocolMessage.
73
74 virtual std::string from() const override ;
75 ///< Override from GSmtp::ProtocolMessage.
76
77 virtual void process( const std::string & auth_id , const std::string & peer_socket_address ,
78 const std::string & peer_certificate ) override ;
79 ///< Override from GSmtp::ProtocolMessage.
80
81 private:
82 void operator=( const ProtocolMessageStore & ) ; // not implemented
83 void filterDone( int ) ;
84
85 private:
86 MessageStore & m_store ;
87 unique_ptr<Filter> m_filter ;
88 unique_ptr<NewMessage> m_new_msg ;
89 std::string m_from ;
90 G::Slot::Signal4<bool,unsigned long,std::string,std::string> m_done_signal ;
91 } ;
92
93 #endif
94
GSmtp
SMTP and message-store classes.
Definition: gadminserver.h:39
G::Slot::Signal4< bool, unsigned long, std::string, std::string >
GSmtp::ProtocolMessageStore::reset
virtual void reset() override
Override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:41
GSmtp::ProtocolMessageStore::doneSignal
virtual G::Slot::Signal4< bool, unsigned long, std::string, std::string > & doneSignal() override
Override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:197
gprotocolmessage.h
GSmtp::ProtocolMessageStore::addTo
virtual bool addTo(const std::string &to_user, VerifierStatus to_status) override
Override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:71
gslot.h
GSmtp::ProtocolMessageStore
A concrete implementation of the ProtocolMessage interface that stores incoming messages in the messa...
Definition: gprotocolmessagestore.h:44
GSmtp::ProtocolMessageStore::from
virtual std::string from() const override
Override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:111
GSmtp::MessageStore
A class which allows SMTP messages to be stored and retrieved.
Definition: gmessagestore.h:43
GSmtp::ProtocolMessageStore::setFrom
virtual bool setFrom(const std::string &from_user, const std::string &) override
Override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:55
GSmtp::ProtocolMessageStore::ProtocolMessageStore
ProtocolMessageStore(MessageStore &store, unique_ptr< Filter >)
Constructor.
Definition: gprotocolmessagestore.cpp:29
GSmtp::ProtocolMessageStore::~ProtocolMessageStore
virtual ~ProtocolMessageStore()
Destructor.
Definition: gprotocolmessagestore.cpp:36
gmessagestore.h
GSmtp::ProtocolMessageStore::clear
virtual void clear() override
Override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:47
GSmtp::ProtocolMessageStore::process
virtual void process(const std::string &auth_id, const std::string &peer_socket_address, const std::string &peer_certificate) override
Override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:116
GSmtp::ProtocolMessageStore::addReceived
virtual void addReceived(const std::string &) override
Override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:96
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:63
gfilter.h
gsmtp.h
gnewmessage.h
GSmtp::ProtocolMessageStore::addText
virtual bool addText(const char *, size_t) override
Override from GSmtp::ProtocolMessage.
Definition: gprotocolmessagestore.cpp:103