E-MailRelay

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

gexecutableverifier.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 gexecutableverifier.h
19 ///
20
21 #ifndef G_SMTP_EXECUTABLE_VERIFIER_H
22 #define G_SMTP_EXECUTABLE_VERIFIER_H
23
24 #include "gdef.h"
25 #include "gsmtp.h"
26 #include "gverifier.h"
27 #include "gtask.h"
28 #include <string>
29
30 namespace GSmtp
31 {
32 class ExecutableVerifier ;
33 }
34
35 /// \class GSmtp::ExecutableVerifier
36 /// A Verifier that runs an executable.
37 ///
38 class GSmtp::ExecutableVerifier : public Verifier, private GNet::TaskCallback
39 {
40 public:
41 ExecutableVerifier( GNet::ExceptionHandler & , const G::Path & , bool compatible ) ;
42 ///< Constructor.
43
44 virtual void verify( const std::string & rcpt_to_parameter ,
45 const std::string & mail_from_parameter , const GNet::Address & client_ip ,
46 const std::string & auth_mechanism , const std::string & auth_extra ) override ;
47 ///< Override from GSmtp::Verifier.
48
49 virtual G::Slot::Signal2<std::string,VerifierStatus> & doneSignal() override ;
50 ///< Override from GSmtp::Verifier.
51
52 virtual void cancel() override ;
53 ///< Override from GSmtp::Verifier.
54
55 private:
56 ExecutableVerifier( const ExecutableVerifier & ) ; // not implemented
57 void operator=( const ExecutableVerifier & ) ; // not implemented
58 virtual void onTaskDone( int , const std::string & ) override ; // override from GNet::TaskCallback
59
60 private:
61 G::Path m_path ;
62 G::Slot::Signal2<std::string,VerifierStatus> m_done_signal ;
63 std::string m_to_address ;
64 GNet::Task m_task ;
65 bool m_compatible ;
66 } ;
67
68 #endif
GSmtp
SMTP and message-store classes.
Definition: gadminserver.h:39
GSmtp::ExecutableVerifier
A Verifier that runs an executable.
Definition: gexecutableverifier.h:38
G::Slot::Signal2
A signal class for two-parameter callbacks.
Definition: gslot.h:337
GNet::Address
The GNet::Address class encapsulates a TCP/UDP transport address.
Definition: gaddress.h:54
GSmtp::ExecutableVerifier::cancel
virtual void cancel() override
Override from GSmtp::Verifier.
Definition: gexecutableverifier.cpp:140
gverifier.h
GSmtp::Verifier
An asynchronous interface that verifies recipient 'to' addresses.
Definition: gverifier.h:43
GNet::ExceptionHandler
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events...
Definition: gexceptionhandler.h:44
GSmtp::ExecutableVerifier::verify
virtual void verify(const std::string &rcpt_to_parameter, const std::string &mail_from_parameter, const GNet::Address &client_ip, const std::string &auth_mechanism, const std::string &auth_extra) override
Override from GSmtp::Verifier.
Definition: gexecutableverifier.cpp:42
GSmtp::ExecutableVerifier::doneSignal
virtual G::Slot::Signal2< std::string, VerifierStatus > & doneSignal() override
Override from GSmtp::Verifier.
Definition: gexecutableverifier.cpp:135
GNet::Task
A class for running an exectuable in a separate process with an asychronous completion callback...
Definition: gtask.h:42
gtask.h
gsmtp.h
GNet::TaskCallback
An abstract interface for callbacks from GNet::Task.
Definition: gtask.h:89
GSmtp::ExecutableVerifier::ExecutableVerifier
ExecutableVerifier(GNet::ExceptionHandler &, const G::Path &, bool compatible)
Constructor.
Definition: gexecutableverifier.cpp:35
G::Path
A Path object represents a file system path.
Definition: gpath.h:72