E-MailRelay

gnetworkverifier.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 gnetworkverifier.h
19///
20
21#ifndef G_SMTP_NETWORK_VERIFIER_H
22#define G_SMTP_NETWORK_VERIFIER_H
23
24#include "gdef.h"
25#include "gverifier.h"
26#include "grequestclient.h"
27#include "gclientptr.h"
28#include <string>
29
30 namespace GSmtp
31{
32 class NetworkVerifier ;
33}
34
35//| \class GSmtp::NetworkVerifier
36/// A Verifier that talks to a remote address verifier over the network.
37///
38 class GSmtp::NetworkVerifier : public Verifier
39{
40 public:
41 NetworkVerifier( GNet::ExceptionSink , const std::string & server ,
42 unsigned int connection_timeout , unsigned int response_timeout ) ;
43 ///< Constructor.
44
45 ~NetworkVerifier() override ;
46 ///< Destructor.
47
48 private: // overrides
49 void verify( const std::string & rcpt_to_parameter ,
50 const std::string & mail_from_parameter , const GNet::Address & client_ip ,
51 const std::string & auth_mechanism , const std::string & auth_extra ) override ; // Override from GSmtp::Verifier.
52 G::Slot::Signal<const VerifierStatus&> & doneSignal() override ; // Override from GSmtp::Verifier.
53 void cancel() override ; // Override from GSmtp::Verifier.
54
55 public:
56 NetworkVerifier( const NetworkVerifier & ) = delete ;
57 NetworkVerifier( NetworkVerifier && ) = delete ;
58 void operator=( const NetworkVerifier & ) = delete ;
59 void operator=( NetworkVerifier && ) = delete ;
60
61 private:
62 void clientEvent( const std::string & , const std::string & , const std::string & ) ;
63 void clientDeleted( const std::string & ) ;
64
65 private:
66 GNet::ExceptionSink m_es ;
67 G::Slot::Signal<const VerifierStatus&> m_done_signal ;
68 GNet::Location m_location ;
69 unsigned int m_connection_timeout ;
70 unsigned int m_response_timeout ;
71 GNet::ClientPtr<RequestClient> m_client_ptr ;
72 std::string m_to_address ;
73} ;
74
75#endif
GNet::Address
The GNet::Address class encapsulates a TCP/UDP transport address.
Definition: gaddress.h:53
GNet::ClientPtr
A smart pointer class for GNet::Client.
Definition: gclientptr.h:135
GNet::ExceptionSink
A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer.
Definition: gexceptionsink.h:100
GNet::Location
A class that represents the remote target for out-going client connections.
Definition: glocation.h:71
GSmtp::NetworkVerifier
A Verifier that talks to a remote address verifier over the network.
Definition: gnetworkverifier.h:39
GSmtp::NetworkVerifier::NetworkVerifier
NetworkVerifier(GNet::ExceptionSink, const std::string &server, unsigned int connection_timeout, unsigned int response_timeout)
Constructor.
Definition: gnetworkverifier.cpp:27
GSmtp::NetworkVerifier::~NetworkVerifier
~NetworkVerifier() override
Destructor.
Definition: gnetworkverifier.cpp:40
GSmtp::Verifier
An asynchronous interface that verifies recipient 'to' addresses.
Definition: gverifier.h:43
gclientptr.h
grequestclient.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