E-MailRelay
gsmtpservertext.h
Go to the documentation of this file.
1//
2// Copyright (C) 2001-2024 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 gsmtpservertext.h
19///
20
21#ifndef G_SMTP_SERVER_TEXT_H
22#define G_SMTP_SERVER_TEXT_H
23
24#include "gdef.h"
25#include "gsmtpserverprotocol.h"
26#include "gaddress.h"
27#include <string>
28
29namespace GSmtp
30{
31 class ServerText ;
32}
33
34//| \class GSmtp::ServerText
35/// A default implementation of the GSmtp::ServerProtocol::Text interface.
36///
38{
39public:
40 ServerText( const std::string & code_ident , bool anonymous , bool with_received_line ,
41 const std::string & greeting_and_receivedline_domain , const GNet::Address & peer_address ) ;
42 ///< Constructor.
43
44 static std::string receivedLine( const std::string & smtp_peer_name ,
45 const std::string & peer_address , const std::string & receivedline_domain ,
46 bool authenticated , bool secure , const std::string & , const std::string & cipher_in ) ;
47
48public:
49 ~ServerText() override = default ;
50 ServerText( const ServerText & ) = default ;
51 ServerText( ServerText && ) = default ;
52 ServerText & operator=( const ServerText & ) = default ;
53 ServerText & operator=( ServerText && ) = default ;
54
55private: // overrides:
56 std::string greeting() const override ; // Override from GSmtp::ServerProtocol::Text.
57 std::string hello( const std::string & smtp_peer_name_from_helo ) const override ; // Override from GSmtp::ServerProtocol::Text.
58 std::string received( const std::string & , bool , bool , const std::string & , const std::string & ) const override ; // Override from GSmtp::ServerProtocol::Text.
59
60private:
61 std::string m_code_ident ;
62 bool m_anonymous ;
63 bool m_with_received_line ;
64 std::string m_domain ; // greeting and receivedline
65 GNet::Address m_peer_address ;
66} ;
67
68#endif
The GNet::Address class encapsulates a TCP/UDP transport address.
Definition: gaddress.h:63
An interface used by GSmtp::ServerProtocol to provide response text strings.
A default implementation of the GSmtp::ServerProtocol::Text interface.
ServerText(const std::string &code_ident, bool anonymous, bool with_received_line, const std::string &greeting_and_receivedline_domain, const GNet::Address &peer_address)
Constructor.
SMTP classes.
Definition: gadminserver.h:42