MCPcopy Create free account
hub / github.com/cutelyst/simple-mail / parseCaps

Method parseCaps

src/server.cpp:643–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643int ServerPrivate::parseCaps()
644{
645 Q_Q(Server);
646
647 // Save the server's response
648 const QByteArray responseText = socket->readLine().trimmed();
649 qCDebug(SIMPLEMAIL_SERVER) << "Got response" << responseText;
650
651 // Extract the respose code from the server's responce (first 3 digits)
652 int responseCode = responseText.left(3).toInt();
653 if (responseCode == 250) {
654 caps.append(QString::fromLatin1(responseText));
655 if (responseText[3] == ' ') {
656 return 1;
657 } else {
658 return 0;
659 }
660 } else {
661 const QString lastError = QString::fromLatin1(responseText);
662 qCWarning(SIMPLEMAIL_SERVER) << "Unexpected server caps" << lastError;
663 Q_EMIT q->smtpError(Server::ServerError, lastError);
664 return -1;
665 }
666}
667
668void ServerPrivate::commandReset()
669{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected