21#ifndef G_SMTP_CLIENT_REPLY_H
22#define G_SMTP_CLIENT_REPLY_H
44 Internal_filter_ok = 2 ,
45 Internal_filter_abandon = 3 ,
46 Internal_filter_error = 4 ,
48 ServiceReady_220 = 220 ,
50 Authenticated_235 = 235 ,
53 SyntaxError_500 = 500 ,
54 SyntaxError_501 = 501 ,
55 NotImplemented_502 = 502 ,
56 BadSequence_503 = 503 ,
57 NotAuthenticated_535 = 535 ,
58 NotAvailable_454 = 454
101 bool is( Value v )
const ;
107 std::string
text()
const ;
120 std::string
reason()
const ;
126 static bool isDigit(
char ) ;
127 static bool validLine(
const std::string & line , std::string & , std::size_t , std::size_t ) ;
132 int m_done_code {0} ;
134 std::string m_filter_reason ;
Encapsulates SMTP replies from a remote client, or replies from a client filter, or the result of a T...
std::string errorText() const
Returns the empty string if positiveCompletion() or non-empty text() or "error".
bool positiveCompletion() const
Returns true if value() is between 200 and 299.
static ClientReply secure()
Factory function for Internal_secure.
static ClientReply filterAbandon()
Factory function for Internal_filter_abandon.
int value() const
Returns the numeric value of the reply.
std::string text() const
Returns the text of the reply, with some whitespace normalisation and no tabs.
static ClientReply start()
Factory function for Internal_start.
bool positive() const
Returns true if value() is between 100 and 399.
std::string reason() const
Returns the filter-reason text from a filterError() reply or the empty string.
static ClientReply filterOk()
Factory function for Internal_filter_ok.
static ClientReply ok()
Factory function returning a generic 'Ok' reply object with a value() of 250.
static bool complete(const G::StringArray &)
Returns true if the reply text is valid() and complete.
bool is(Value v) const
Returns true if the value() is as given.
static ClientReply filterError(const std::string &response, const std::string &filter_reason)
Factory function for Internal_filter_error.
int doneCode() const
Returns -1 for filterAbandon() or -2 for filterError() or zero if less than 100 or value().
static bool valid(const G::StringArray &)
Returns true if the reply text is syntactivally valid but possibly incomplete.
std::vector< std::string > StringArray
A std::vector of std::strings.