E-MailRelay

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

gnetworkverifier.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 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 "gsmtp.h"
26 #include "gverifier.h"
27 #include "grequestclient.h"
28 #include "gclientptr.h"
29 #include <string>
30
31 namespace GSmtp
32 {
33 class NetworkVerifier ;
34 }
35
36 /// \class GSmtp::NetworkVerifier
37 /// A Verifier that talks to a remote verifier over the network.
38 ///
39 class GSmtp::NetworkVerifier : public Verifier
40 {
41 public:
42 NetworkVerifier( GNet::ExceptionHandler & , const std::string & server ,
43 unsigned int connection_timeout , unsigned int response_timeout , bool compatible ) ;
44 ///< Constructor.
45
46 virtual ~NetworkVerifier() ;
47 ///< Destructor.
48
49 virtual 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 ;
52 ///< Override from GSmtp::Verifier.
53
54 virtual G::Slot::Signal2<std::string,VerifierStatus> & doneSignal() override ;
55 ///< Override from GSmtp::Verifier.
56
57 virtual void cancel() override ;
58 ///< Override from GSmtp::Verifier.
59
60 private:
61 NetworkVerifier( const NetworkVerifier & ) ;
62 void operator=( const NetworkVerifier & ) ;
63 void clientEvent( std::string , std::string ) ;
64
65 private:
66 GNet::ExceptionHandler & m_exception_handler ;
67 G::Slot::Signal2<std::string,VerifierStatus> m_done_signal ;
68 GNet::Location m_location ;
69 unsigned int m_connection_timeout ;
70 unsigned int m_response_timeout ;
71 bool m_lazy ;
72 bool m_compatible ;
73 GNet::ClientPtr<RequestClient> m_client ;
74 std::string m_to_address ;
75 } ;
76
77 #endif
GSmtp::NetworkVerifier::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: gnetworkverifier.cpp:47
GSmtp
SMTP and message-store classes.
Definition: gadminserver.h:39
G::Slot::Signal2
A signal class for two-parameter callbacks.
Definition: gslot.h:337
GSmtp::NetworkVerifier::doneSignal
virtual G::Slot::Signal2< std::string, VerifierStatus > & doneSignal() override
Override from GSmtp::Verifier.
Definition: gnetworkverifier.cpp:137
GNet::Address
The GNet::Address class encapsulates a TCP/UDP transport address.
Definition: gaddress.h:54
GSmtp::NetworkVerifier
A Verifier that talks to a remote verifier over the network.
Definition: gnetworkverifier.h:39
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::NetworkVerifier::~NetworkVerifier
virtual ~NetworkVerifier()
Destructor.
Definition: gnetworkverifier.cpp:42
GSmtp::NetworkVerifier::cancel
virtual void cancel() override
Override from GSmtp::Verifier.
Definition: gnetworkverifier.cpp:142
GNet::Location
A class that holds a host/service name pair and the preferred address family (if any), and also the results of a name-to-address lookup, ie.
Definition: glocation.h:50
GSmtp::NetworkVerifier::NetworkVerifier
NetworkVerifier(GNet::ExceptionHandler &, const std::string &server, unsigned int connection_timeout, unsigned int response_timeout, bool compatible)
Constructor.
Definition: gnetworkverifier.cpp:28
gclientptr.h
GNet::ClientPtr
A smart pointer class for GNet::HeapClient that keeps track of when the contained instance deletes it...
Definition: gclientptr.h:33
grequestclient.h
gsmtp.h