E-MailRelay
gverifierstatus.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 gverifierstatus.h
19 ///
20 
21 #ifndef G_SMTP_VERIFIER_STATUS_H
22 #define G_SMTP_VERIFIER_STATUS_H
23 
24 #include "gdef.h"
25 #include "gsmtp.h"
26 #include <string>
27 
28 namespace GSmtp
29 {
30  class VerifierStatus ;
31 }
32 
33 /// \class GSmtp::VerifierStatus
34 /// A structure returned by GSmtp::Verifier to describe the status of
35 /// a 'rcpt-to' recipient.
36 ///
37 /// If describing an invalid recipient then 'is_valid' is set false
38 /// and a 'response' is supplied. The response is typically reported back
39 /// to the submitter, so it should not contain too much detail.
40 ///
41 /// The 'reason' string can be added by the user of the verifier to give
42 /// more context in the log in addition to 'response'.
43 ///
44 /// If a valid local recipient then 'is_local' is set true, 'full_name'
45 /// is set to the full description of the mailbox and 'address' is set
46 /// to the recipient's mailbox name (which should not have an at sign).
47 ///
48 /// If a valid remote recipient then 'is_local' is set false, 'full_name'
49 /// is empty, and 'address' is copied from the original recipient 'to' address.
50 ///
52 {
53 public:
54  bool is_valid ;
55  bool is_local ;
56  bool temporary ;
57  bool abort ;
58  std::string full_name ;
59  std::string address ;
60  std::string response ;
61  std::string reason ;
62 
63  VerifierStatus() ;
64  ///< Default constructor for an invalid remote mailbox.
65 
66  explicit VerifierStatus( const std::string & ) ;
67  ///< Constructor for a valid remote mailbox with the
68  ///< given 'address' field.
69 
70  static VerifierStatus parse( const std::string & str , std::string & to_ref ) ;
71  ///< Parses a str() string into a structure and a
72  ///< recipient 'to' address (by reference).
73 
74  std::string str( const std::string & to ) const ;
75  ///< Returns a string representation of the structure
76  ///< plus the original recipient 'to' address.
77 } ;
78 
79 #endif
SMTP and message-store classes.
Definition: gadminserver.h:39
static VerifierStatus parse(const std::string &str, std::string &to_ref)
Parses a str() string into a structure and a recipient 'to' address (by reference).
VerifierStatus()
Default constructor for an invalid remote mailbox.
A structure returned by GSmtp::Verifier to describe the status of a 'rcpt-to' recipient.
std::string str(const std::string &to) const
Returns a string representation of the structure plus the original recipient 'to' address...