41 m_thishost(config.thishost_name) ,
45 m_server_has_starttls(false) ,
46 m_server_has_auth(false) ,
47 m_server_secure(false) ,
48 m_server_has_8bitmime(false) ,
49 m_message_is_8bit(false) ,
50 m_authenticated_with_server(false) ,
51 m_must_authenticate(config.must_authenticate) ,
52 m_anonymous(config.anonymous) ,
53 m_must_accept_all_recipients(config.must_accept_all_recipients) ,
54 m_use_starttls_if_possible(config.use_starttls_if_possible) ,
55 m_must_use_tls(config.must_use_tls) ,
56 m_in_secure_tunnel(in_secure_tunnel) ,
57 m_strict(config.eight_bit_strict) ,
59 m_response_timeout(config.response_timeout) ,
60 m_ready_timeout(config.ready_timeout) ,
61 m_filter_timeout(config.filter_timeout) ,
68 bool eight_bit , std::string mail_from_auth , unique_ptr<std::istream> content )
70 G_DEBUG(
"GSmtp::ClientProtocol::start" ) ;
77 m_content.reset( content.release() ) ;
78 m_message_is_8bit = eight_bit ;
79 m_message_mail_from_auth = mail_from_auth ;
83 m_done_signal.reset() ;
84 applyEvent(
Reply() ,
true ) ;
89 G_DEBUG(
"GSmtp::ClientProtocol::finish" ) ;
90 m_response_timeout = 1U ;
98 applyEvent( Reply::ok(Reply::Internal_secure) ) ;
103 if( m_state == sData )
105 size_t n = sendLines() ;
107 G_LOG(
"GSmtp::ClientProtocol: tx>>: [" << n <<
" line(s) of content]" ) ;
116 bool GSmtp::ClientProtocol::parseReply( Reply & stored_reply ,
const std::string & rx , std::string & reason )
118 Reply this_reply = Reply( rx ) ;
119 if( ! this_reply.validFormat() )
121 stored_reply = Reply() ;
122 reason =
"invalid reply format" ;
125 else if( stored_reply.validFormat() && stored_reply.incomplete() )
127 if( ! stored_reply.add(this_reply) )
129 stored_reply = Reply() ;
130 reason =
"invalid continuation line" ;
136 stored_reply = this_reply ;
138 return ! stored_reply.incomplete() ;
146 bool protocol_done = false ;
147 bool complete_reply = parseReply( m_reply , rx , reason ) ;
150 protocol_done = applyEvent( m_reply ) ;
154 if( reason.length() != 0U )
155 send(
"550 syntax error: " , reason ) ;
157 return protocol_done ;
160 void GSmtp::ClientProtocol::sendEhlo()
162 send(
"EHLO " , m_thishost ) ;
165 void GSmtp::ClientProtocol::sendHelo()
167 send(
"HELO " , m_thishost ) ;
170 void GSmtp::ClientProtocol::sendMail()
172 const bool dodgy = m_message_is_8bit && !m_server_has_8bitmime ;
173 if( dodgy && m_strict )
175 m_state = sMessageDone ;
176 raiseDoneSignal( 0 ,
"failed" ,
"cannot send 8-bit message to 7-bit server" ) ;
180 if( dodgy && !m_warned )
183 G_WARNING(
"GSmtp::ClientProtocol::sendMail: sending an eight-bit message "
184 "to a server which has not advertised the 8BITMIME extension" ) ;
190 void GSmtp::ClientProtocol::sendMailCore()
192 std::string mail_from_tail = m_from ;
193 mail_from_tail.append( 1U ,
'>' ) ;
194 if( m_server_has_8bitmime )
196 mail_from_tail.append(
" BODY=8BITMIME" ) ;
198 if( m_authenticated_with_server && m_message_mail_from_auth.empty() && !m_sasl->id().empty() )
202 mail_from_tail.append(
" AUTH=" ) ;
205 else if( m_authenticated_with_server &&
G::Xtext::valid(m_message_mail_from_auth) )
207 mail_from_tail.append(
" AUTH=" ) ;
208 mail_from_tail.append( m_message_mail_from_auth ) ;
210 else if( m_authenticated_with_server )
212 mail_from_tail.append(
" AUTH=<>" ) ;
214 send(
"MAIL FROM:<" , mail_from_tail ) ;
217 bool GSmtp::ClientProtocol::applyEvent(
const Reply & reply ,
bool is_start_event )
219 G_DEBUG(
"GSmtp::ClientProtocol::applyEvent: " << reply.value() <<
": " <<
G::Str::printable(reply.text()) ) ;
223 bool protocol_done = false ;
224 if( m_state == sInit && is_start_event )
228 if( m_ready_timeout != 0U )
229 startTimer( m_ready_timeout ) ;
231 else if( m_state == sInit && reply.is(Reply::ServiceReady_220) )
234 G_DEBUG(
"GSmtp::ClientProtocol::applyEvent: init -> ready" ) ;
235 m_state = sServiceReady ;
237 else if( m_state == sServiceReady && is_start_event )
240 G_DEBUG(
"GSmtp::ClientProtocol::applyEvent: ready -> sent-ehlo" ) ;
241 m_state = sSentEhlo ;
244 else if( m_state == sStarted && reply.is(Reply::ServiceReady_220) )
247 G_DEBUG(
"GSmtp::ClientProtocol::applyEvent: start -> sent-ehlo" ) ;
248 m_state = sSentEhlo ;
251 else if( m_state == sMessageDone && is_start_event )
254 m_state = sFiltering ;
257 else if( m_state == sSentEhlo && (
258 reply.is(Reply::SyntaxError_500) ||
259 reply.is(Reply::SyntaxError_501) ||
260 reply.is(Reply::NotImplemented_502) ) )
263 if( m_must_use_tls && !m_in_secure_tunnel )
throw SmtpError(
"tls is mandated but the server cannot do esmtp" ) ;
264 m_state = sSentHelo ;
267 else if( ( m_state == sSentEhlo || m_state == sSentHelo || m_state == sSentTlsEhlo ) && reply.is(Reply::Ok_250) )
270 G_DEBUG(
"GSmtp::ClientProtocol::applyEvent: ehlo/rset reply \"" <<
G::Str::printable(reply.text()) <<
"\"" ) ;
271 if( m_state == sSentEhlo || m_state == sSentTlsEhlo )
273 m_server_has_starttls = m_state == sSentEhlo && reply.textContains(
"\nSTARTTLS") ;
274 m_server_has_8bitmime = reply.textContains(
"\n8BITMIME");
275 m_server_has_auth = serverAuth( reply ) ;
276 m_server_auth_mechanisms = serverAuthMechanisms( reply ) ;
277 m_server_secure = m_state == sSentTlsEhlo || m_in_secure_tunnel ;
279 m_auth_mechanism = m_sasl->preferred( m_server_auth_mechanisms ) ;
281 if( !m_server_secure && m_must_use_tls )
283 if( !m_server_has_starttls )
284 throw SmtpError(
"tls is mandated but the server cannot do starttls" ) ;
285 m_state = sStartTls ;
288 else if( !m_server_secure && m_use_starttls_if_possible && m_server_has_starttls )
290 m_state = sStartTls ;
293 else if( m_server_has_auth && !m_sasl->active() )
296 G_LOG(
"GSmtp::ClientProtocol: not authenticating with the remote server since no "
297 "client authentication secret has been configured" ) ;
298 m_state = sFiltering ;
301 else if( m_server_has_auth && m_sasl->active() && m_auth_mechanism.empty() )
303 SmtpError error(
"cannot do authentication required by remote server: add a client secret" ) ;
304 G_WARNING(
"GSmtp::ClientProtocol::applyEvent: " << error.what() ) ;
307 else if( m_server_has_auth && m_sasl->active() )
310 send(
"AUTH " , m_auth_mechanism ) ;
312 else if( !m_server_has_auth && m_sasl->active() && m_must_authenticate )
314 SmtpError error(
"authentication is not supported by the remote smtp server" ) ;
315 G_WARNING(
"GSmtp::ClientProtocol::applyEvent: " << error.what() ) ;
320 m_state = sFiltering ;
324 else if( m_state == sStartTls && reply.is(Reply::ServiceReady_220) )
327 m_sender.protocolSend( std::string() , 0U ,
true ) ;
329 else if( m_state == sStartTls && reply.is(Reply::NotAvailable_454) )
332 throw TlsError( reply.errorText() ) ;
334 else if( m_state == sStartTls && reply.is(Reply::Internal_secure) )
337 m_state = sSentTlsEhlo ;
340 else if( m_state == sAuth1 && reply.is(Reply::Challenge_334) &&
344 std::string challenge = m_auth_mechanism ==
"PLAIN" ? std::string() :
G::Base64::decode( reply.text() ) ;
353 m_state = rsp.final ? sAuth2 : m_state ;
357 else if( m_state == sAuth1 && !reply.positive() && m_sasl->next() )
360 AuthError error( *m_sasl.get() , reply ) ;
361 G_LOG(
"GSmtp::ClientProtocol::applyEvent: " << error.what() <<
": trying [" <<
G::Str::lower(m_sasl->preferred()) <<
"]" ) ;
362 m_auth_mechanism = m_sasl->preferred() ;
364 send(
"AUTH " , m_auth_mechanism ) ;
366 else if( m_state == sAuth1 && !reply.positive() && m_must_authenticate )
369 AuthError error( *m_sasl.get() , reply ) ;
370 G_WARNING(
"GSmtp::ClientProtocol::applyEvent: " << error.what() ) ;
373 else if( m_state == sAuth1 && !reply.positive() )
376 G_ASSERT( !m_authenticated_with_server ) ;
377 G_WARNING(
"GSmtp::ClientProtocol::applyEvent: " << AuthError(*m_sasl.get(),reply).str() <<
": continuing" ) ;
378 m_state = sFiltering ;
381 else if( m_state == sAuth2 && reply.is(Reply::Challenge_334) &&
G::Base64::valid(reply.text()) )
390 else if( m_state == sAuth2 && !reply.positive() && m_sasl->next() )
393 G_LOG(
"GSmtp::ClientProtocol::applyEvent: " << AuthError(*m_sasl.get(),reply).str() <<
": trying [" <<
G::Str::lower(m_sasl->preferred()) <<
"]" ) ;
394 m_auth_mechanism = m_sasl->preferred() ;
396 send(
"AUTH " , m_auth_mechanism ) ;
398 else if( m_state == sAuth2 && reply.is(Reply::Authenticated_235) )
401 m_authenticated_with_server = true ;
402 G_LOG(
"GSmtp::ClientProtocol::applyEvent: successful authentication with remote server " << m_sasl->info() ) ;
403 m_state = sFiltering ;
406 else if( m_state == sAuth2 && m_must_authenticate )
409 AuthError error( *m_sasl.get() , reply ) ;
410 G_WARNING(
"GSmtp::ClientProtocol::applyEvent: " << error.what() ) ;
413 else if( m_state == sAuth2 )
416 G_ASSERT( !m_authenticated_with_server ) ;
417 G_WARNING(
"GSmtp::ClientProtocol::applyEvent: " << AuthError(*m_sasl.get(),reply).str() <<
"]: continuing" ) ;
418 m_state = sFiltering ;
421 else if( m_state == sFiltering && reply.is(Reply::Internal_filter_ok) )
424 m_state = sSentMail ;
427 else if( m_state == sFiltering && reply.is(Reply::Internal_filter_abandon) )
430 m_state = sMessageDone ;
431 raiseDoneSignal( -1 , std::string() ) ;
433 else if( m_state == sFiltering && reply.is(Reply::Internal_filter_error) )
436 m_state = sMessageDone ;
437 raiseDoneSignal( -2 , reply.errorText() , reply.errorReason() ) ;
439 else if( m_state == sSentMail && reply.is(Reply::Ok_250) )
442 std::string to = m_to.at( m_to_index++ ) ;
443 m_state = sSentRcpt ;
444 send(
"RCPT TO:<" , to ,
">" ) ;
446 else if( m_state == sSentRcpt && m_to_index < m_to.size() )
449 if( reply.positive() )
452 G_WARNING(
"GSmtp::ClientProtocol: recipient rejected" ) ;
454 std::string to = m_to.at( m_to_index++ ) ;
455 send(
"RCPT TO:<" , to ,
">" ) ;
457 else if( m_state == sSentRcpt )
460 if( reply.positive() )
463 G_WARNING(
"GSmtp::ClientProtocol: recipient rejected" ) ;
465 if( ( m_must_accept_all_recipients && m_to_accepted != m_to.size() ) || m_to_accepted == 0U )
467 m_state = sSentDataStub ;
472 m_state = sSentData ;
476 else if( m_state == sSentData && reply.is(Reply::OkForData_354) )
480 size_t n = sendLines() ;
481 G_LOG(
"GSmtp::ClientProtocol: tx>>: [" << n <<
" line(s) of content]" ) ;
488 else if( m_state == sSentDataStub )
491 m_state = sMessageDone ;
492 std::string how_many = m_must_accept_all_recipients ? std::string(
"one or more") :
std::string(
"all") ;
493 raiseDoneSignal( reply.value() , how_many +
" recipients rejected" ) ;
495 else if( m_state == sSentDot )
498 m_state = sMessageDone ;
499 raiseDoneSignal( reply.value() , reply.errorText() ) ;
501 else if( m_state == sQuitting && reply.value() == 221 )
504 protocol_done = true ;
506 else if( is_start_event )
513 G_WARNING(
"GSmtp::ClientProtocol: failure in client protocol: state " << static_cast<int>(m_state)
515 throw SmtpError(
"unexpected response" , reply.errorText() ) ;
517 return protocol_done ;
522 if( m_state == sStarted )
525 G_WARNING(
"GSmtp::ClientProtocol: timeout: no greeting from remote server after " << m_ready_timeout <<
"s: continuing" ) ;
526 m_state = sSentEhlo ;
529 else if( m_state == sFiltering )
531 throw SmtpError(
"filtering timeout after " +
G::Str::fromUInt(m_filter_timeout) +
"s" ) ;
533 else if( m_state == sData )
535 throw SmtpError(
"flow-control timeout after " +
G::Str::fromUInt(m_response_timeout) +
"s" ) ;
539 throw SmtpError(
"response timeout after " +
G::Str::fromUInt(m_response_timeout) +
"s" ) ;
545 return !reply.
textLine(
"AUTH ").empty() ;
548 G::StringArray GSmtp::ClientProtocol::serverAuthMechanisms(
const ClientProtocolReply & reply )
const
551 std::string auth_line = reply.textLine(
"AUTH ") ;
552 if( ! auth_line.empty() )
554 std::string tail =
G::Str::tail( auth_line , auth_line.find(
" ") , std::string() ) ;
560 void GSmtp::ClientProtocol::startFiltering()
562 G_ASSERT( m_state == sFiltering ) ;
563 if( m_filter_timeout != 0U )
564 startTimer( m_filter_timeout ) ;
565 m_filter_signal.emit() ;
573 applyEvent( Reply::ok(Reply::Internal_filter_ok) ) ;
575 else if( response.empty() )
578 applyEvent( Reply::ok(Reply::Internal_filter_abandon) ) ;
583 applyEvent( Reply::error(Reply::Internal_filter_error,response,reason) ) ;
587 void GSmtp::ClientProtocol::raiseDoneSignal(
int response_code ,
const std::string & response ,
const std::string & reason )
589 if( ! response.empty() && response_code == 0 )
590 G_WARNING(
"GSmtp::ClientProtocol: smtp client protocol: " << response ) ;
594 m_done_signal.emit( response_code , response , reason ) ;
597 bool GSmtp::ClientProtocol::endOfContent()
const
599 return !m_content->good() ;
602 size_t GSmtp::ClientProtocol::sendLines()
607 std::string line( 200U ,
'.' ) ;
610 while( sendLine(line) )
615 bool GSmtp::ClientProtocol::sendLine( std::string & line )
620 std::istream & stream = *(m_content.get()) ;
623 const bool pre_erase = false ;
625 G_ASSERT( line.length() >= 1U && line.at(0U) ==
'.' ) ;
630 if( !line.empty() && line.at(line.size()-1U) !=
'\r' )
631 line.append( 1U ,
'\r' ) ;
632 line.append( 1U ,
'\n' ) ;
634 bool all_sent = m_sender.protocolSend( line , line.at(1U) ==
'.' ? 0U : 1U , false ) ;
635 if( !all_sent && m_response_timeout != 0U )
636 startTimer( m_response_timeout ) ;
643 void GSmtp::ClientProtocol::send(
const char * p )
645 send( std::string(p) ,
false ,
false ) ;
648 void GSmtp::ClientProtocol::send(
const char * p ,
const std::string & s ,
const char * p2 )
650 std::string line( p ) ;
653 send( line ,
false ,
false ) ;
656 void GSmtp::ClientProtocol::send(
const char * p ,
const std::string & s )
658 send( std::string(p) + s ,
false ,
false ) ;
661 bool GSmtp::ClientProtocol::send(
const std::string & line ,
bool eot ,
bool sensitive )
663 if( m_response_timeout != 0U )
664 startTimer( m_response_timeout ) ;
666 bool dot_prefix = !eot && line.length() && line.at(0U) ==
'.' ;
669 G_LOG(
"GSmtp::ClientProtocol: tx>>: [response not logged]" ) ;
673 G_LOG(
"GSmtp::ClientProtocol: tx>>: \"" << (dot_prefix?
".":
"") <<
G::Str::printable(line) <<
"\"" ) ;
675 return m_sender.protocolSend( (dot_prefix?
".":
"") + line +
"\r\n" , 0U ,
false ) ;
680 return m_done_signal ;
685 return m_filter_signal ;
694 if( line.length() >= 3U &&
695 is_digit(line.at(0U)) &&
696 line.at(0U) <=
'5' &&
697 is_digit(line.at(1U)) &&
698 is_digit(line.at(2U)) &&
699 ( line.length() == 3U || line.at(3U) ==
' ' || line.at(3U) ==
'-' ) )
702 m_complete = line.length() == 3U || line.at(3U) ==
' ' ;
704 if( line.length() > 4U )
706 m_text = line.substr(4U) ;
723 reply.m_text =
"OK\n" + text ;
724 G_ASSERT( reply.
positive() ) ;
if( !reply.
positive() ) reply.m_value = 250 ;
731 reply.m_value = ( v >= 500 && v < 600 ) ? v : 500 ;
732 reply.m_reason = reason ;
743 return ! m_complete ;
748 return m_valid && m_value < 400 ;
753 return m_valid ? m_value : 0 ;
758 return value() == v ;
763 const bool positive_completion = type() == PositiveCompletion ;
764 return positive_completion ? std::string() : ( m_text.empty() ? std::string(
"error") : m_text ) ;
779 size_t start_pos = m_text.find( std::string(
"\n")+prefix ) ;
780 if( start_pos == std::string::npos )
782 return std::string() ;
787 size_t end_pos = m_text.find(
"\n" , start_pos + prefix.length() ) ;
788 return m_text.substr( start_pos , end_pos-start_pos ) ;
792 bool GSmtp::ClientProtocolReply::is_digit(
char c )
794 return c >=
'0' && c <=
'9' ;
799 G_ASSERT( m_valid && (m_value/100) >= 1 && (m_value/100) <= 5 ) ;
800 return static_cast<Type
>( m_value / 100 ) ;
805 G_ASSERT( m_valid && m_value >= 0 ) ;
806 int n = ( m_value / 10 ) % 10 ;
808 return static_cast<SubType
>( n ) ;
810 return Invalid_SubType ;
815 G_ASSERT( other.m_valid ) ;
816 G_ASSERT( m_valid ) ;
817 G_ASSERT( !m_complete ) ;
819 m_complete = other.m_complete ;
820 m_text.append( std::string(
"\n") + other.
text() ) ;
821 return value() == other.
value() ;
826 std::string text( m_text ) ;
829 return text.find(key) != std::string::npos ;
834 GSmtp::ClientProtocol::Sender::~Sender()
840 GSmtp::ClientProtocol::Config::Config(
const std::string & name_ ,
841 unsigned int response_timeout_ ,
842 unsigned int ready_timeout_ ,
unsigned int filter_timeout_ ,
843 bool use_starttls_if_possible_ ,
bool must_use_tls_ ,
844 bool must_authenticate_ ,
bool anonymous_ ,
845 bool must_accept_all_recipients_ ,
bool eight_bit_strict_ ) :
846 thishost_name(name_) ,
847 response_timeout(response_timeout_) ,
848 ready_timeout(ready_timeout_) ,
849 filter_timeout(filter_timeout_) ,
850 use_starttls_if_possible(use_starttls_if_possible_) ,
851 must_use_tls(must_use_tls_) ,
852 must_authenticate(must_authenticate_) ,
853 anonymous(anonymous_) ,
854 must_accept_all_recipients(must_accept_all_recipients_) ,
855 eight_bit_strict(eight_bit_strict_)
862 SmtpError(
"authentication failed " + sasl.info() +
": [" +
G::Str::printable(reply.text()) +
"]" )
866 std::string GSmtp::ClientProtocol::AuthError::str()
const
868 return std::string( what() ) ;
void secure()
To be called when the secure socket protocol has been successfully established.
An interface to an underlying TLS library.
static bool valid(const std::string &)
Returns true if the string can be decoded without any strict errors.
static std::string printable(const std::string &in, char escape= '\\')
Returns a printable represention of the given input string.
static std::string tail(const std::string &in, size_type pos, const std::string &default_=std::string())
Returns the last part of the string after the given position.
Type type() const
Returns the reply type (category).
static ClientProtocolReply error(Value, const std::string &response, const std::string &error_reason)
Factory function for an error reply with a specific 5xx value.
bool incomplete() const
Returns true if the reply is incomplete.
std::string errorText() const
Returns the text() string, plus any error reason, but with the guarantee that the returned string is ...
ClientProtocol(GNet::ExceptionHandler &, Sender &sender, const GAuth::Secrets &secrets, Config config, bool in_secure_tunnel)
Constructor.
static int toInt(const std::string &s)
Converts string 's' to an int.
G::Slot::Signal0 & filterSignal()
Returns a signal that is raised when the protocol needs to do message filtering.
static std::string encode(const std::string &)
Encodes the given string.
bool validFormat() const
Returns true if a valid format.
std::vector< std::string > StringArray
A std::vector of std::strings.
G::Slot::Signal3< int, std::string, std::string > & doneSignal()
Returns a signal that is raised once the protocol has finished with a given message.
static std::string decode(const std::string &, bool strict=false)
Decodes the given string.
virtual void onTimeout() override
Override from GNet::TimerBase.
static void splitIntoTokens(const std::string &in, StringArray &out, const std::string &ws)
Splits the string into 'ws'-delimited tokens.
A structure containing GSmtp::ClientProtocol configuration parameters.
static void trimLeft(std::string &s, const std::string &ws, size_type limit=0U)
Trims the lhs of s, taking off up to 'limit' of the 'ws' characters.
An interface used by ClientProtocol to send protocol messages.
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events...
bool is(Value v) const
Returns true if the reply value is 'v'.
static std::string lower(const std::string &s)
Returns a copy of 's' in which all Latin-1 uppercase characters have been replaced by lowercase chara...
void filterDone(bool ok, const std::string &response, const std::string &reason)
To be called when the Filter interface has done its thing.
static bool valid(const std::string &)
Returns true if a valid encoding.
static std::string fromUInt(unsigned int ui)
Converts unsigned int 'ui' to a string.
void finish()
Called after the last message has been sent.
ClientProtocolReply(const std::string &line=std::string())
Constructor for one line of text.
static unsigned int replaceAll(std::string &s, const std::string &from, const std::string &to)
Does a global replace on string 's', replacing all occurances of sub-string 'from' with 'to'...
A simple interface for a store of secrets used in authentication.
static ClientProtocolReply ok()
Factory function for an ok reply.
std::string textLine(const std::string &prefix) const
Returns a line of text() which starts with prefix.
void sendDone()
To be called when a blocked connection becomes unblocked.
std::string errorReason() const
Returns an error reason string, as passed to error().
int value() const
Returns the numeric value of the reply.
static std::string readLineFrom(std::istream &stream, const std::string &eol=std::string())
Reads a line from the stream using the given line terminator.
A signal class for zero-parameter callbacks.
SubType subType() const
Returns the reply sub-type.
void start(const std::string &from, const G::StringArray &to, bool eight_bit, std::string mail_from_auth, unique_ptr< std::istream > content)
Starts transmission of the given message.
bool apply(const std::string &rx)
Called on receipt of a line of text from the server.
A class that implements the client-side SASL challenge/response concept.
bool textContains(std::string s) const
Returns true if the text() contains the given substring.
bool add(const ClientProtocolReply &other)
Adds more lines to this reply.
bool positive() const
Returns true if the numeric value of the reply is less that four hundred.
static std::string encode(const std::string &s, const std::string &line_break)
Encodes the given string.
static std::string ws()
Returns a string of standard whitespace characters.
A private implementation class used by ClientProtocol.
std::string text() const
Returns the text of the reply, excluding the numeric part, and with embedded newlines.
static void toUpper(std::string &s)
Replaces all Latin-1 lowercase characters in string 's' by uppercase characters.
Result structure returned from GAuth::SaslClient::response.