E-MailRelay

gexecutableverifier.h
Go to the documentation of this file.
1//
2// Copyright (C) 2001-2021 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 "gverifier.h"
26#include "gtask.h"
27#include <string>
28
29 namespace GSmtp
30{
31 class ExecutableVerifier ;
32}
33
34//| \class GSmtp::ExecutableVerifier
35/// A Verifier that runs an executable.
36///
37 class GSmtp::ExecutableVerifier : public Verifier, private GNet::TaskCallback
38{
39 public:
40 ExecutableVerifier( GNet::ExceptionSink , const G::Path & ) ;
41 ///< Constructor.
42
43 private: // overrides
44 G::Slot::Signal<const VerifierStatus&> & doneSignal() override ; // Override from GSmtp::Verifier.
45 void cancel() override ; // Override from GSmtp::Verifier.
46 void onTaskDone( int , const std::string & ) override ; // override from GNet::TaskCallback
47 void verify( const std::string & rcpt_to_parameter ,
48 const std::string & mail_from_parameter , const GNet::Address & client_ip ,
49 const std::string & auth_mechanism , const std::string & auth_extra ) override ; // Override from GSmtp::Verifier.
50
51 public:
52 ~ExecutableVerifier() override = default ;
53 ExecutableVerifier( const ExecutableVerifier & ) = delete ;
54 ExecutableVerifier( ExecutableVerifier && ) = delete ;
55 void operator=( const ExecutableVerifier & ) = delete ;
56 void operator=( ExecutableVerifier && ) = delete ;
57
58 private:
59 G::Path m_path ;
60 G::Slot::Signal<const VerifierStatus&> m_done_signal ;
61 std::string m_to_address ;
62 GNet::Task m_task ;
63} ;
64
65#endif
GNet::Address
The GNet::Address class encapsulates a TCP/UDP transport address.
Definition: gaddress.h:53
GNet::ExceptionSink
A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer.
Definition: gexceptionsink.h:100
GNet::TaskCallback
An abstract interface for callbacks from GNet::Task.
Definition: gtask.h:113
GNet::Task
A class for running an exectuable in a separate process with an asychronous completion callback.
Definition: gtask.h:45
GSmtp::ExecutableVerifier
A Verifier that runs an executable.
Definition: gexecutableverifier.h:38
GSmtp::ExecutableVerifier::ExecutableVerifier
ExecutableVerifier(GNet::ExceptionSink, const G::Path &)
Constructor.
Definition: gexecutableverifier.cpp:32
GSmtp::Verifier
An asynchronous interface that verifies recipient 'to' addresses.
Definition: gverifier.h:43
G::Path
A Path object represents a file system path.
Definition: gpath.h:72
gtask.h
gverifier.h
GSmtp
SMTP and message-store classes.
Definition: gadminserver.h:39
G::Slot::Signal
A slot holder, with connect() and emit() methods.
Definition: gslot.h:157