Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
qxtsmtp_p.h
Go to the documentation of this file.
1/****************************************************************************
2 **
3 ** Copyright (C) Qxt Foundation. Some rights reserved.
4 **
5 ** This file is part of the QxtWeb module of the Qxt library.
6 **
7 ** This library is free software; you can redistribute it and/or modify it
8 ** under the terms of the Common Public License, version 1.0, as published
9 ** by IBM, and/or under the terms of the GNU Lesser General Public License,
10 ** version 2.1, as published by the Free Software Foundation.
11 **
12 ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
13 ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
14 ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
15 ** FITNESS FOR A PARTICULAR PURPOSE.
16 **
17 ** You should have received a copy of the CPL and the LGPL along with this
18 ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files
19 ** included with the source distribution for more information.
20 ** If you did not receive a copy of the licenses, contact the Qxt Foundation.
21 **
22 ** <http://libqxt.org> <foundation@libqxt.org>
23 **
24 ****************************************************************************/
25#ifndef QXTSMTP_P_H
26#define QXTSMTP_P_H
27
28#include "qxtsmtp.h"
29#include <QHash>
30#include <QString>
31#include <QList>
32#include <QPair>
33
34class QxtSmtpPrivate : public QObject, public QxtPrivate<QxtSmtp>
35{
36 Q_OBJECT
37public:
39
41
63
70
72 SmtpState state;// rather then an int use the enum. makes sure invalid states are entered at compile time, and makes debugging easier
74 QByteArray buffer, username, password;
75 QHash<QString, QString> extensions;
76 QList<QPair<int, QxtMailMessage> > pending;
77 QStringList recipients;
79 bool mailAck;
80
81 QSslSocket* socket;
82
83 void parseEhlo(const QByteArray& code, bool cont, const QString& line);
84 void startTLS();
85 void authenticate();
86
87 void authCramMD5(const QByteArray& challenge = QByteArray());
88 void authPlain();
89 void authLogin();
90
91 void sendNextRcpt(const QByteArray& code, const QByteArray & line);
92 void sendBody(const QByteArray& code, const QByteArray & line);
93
94public slots:
95 void socketError(QAbstractSocket::SocketError err);
96 void socketRead();
97
98 void ehlo();
99 void sendNext();
100};
101
102#endif // QXTSMTP_P_H
Definition qxtglobal.h:153
void sendBody(const QByteArray &code, const QByteArray &line)
Definition qxtsmtp.cpp:524
bool mailAck
Definition qxtsmtp_p.h:79
int nextID
Definition qxtsmtp_p.h:78
int rcptNumber
Definition qxtsmtp_p.h:78
bool disableStartTLS
Definition qxtsmtp_p.h:71
int rcptAck
Definition qxtsmtp_p.h:78
void startTLS()
Definition qxtsmtp.cpp:325
void sendNext()
Definition qxtsmtp.cpp:435
void authenticate()
Definition qxtsmtp.cpp:331
void authCramMD5(const QByteArray &challenge=QByteArray())
Definition qxtsmtp.cpp:355
QByteArray password
Definition qxtsmtp_p.h:74
AuthType
Definition qxtsmtp_p.h:65
@ AuthPlain
Definition qxtsmtp_p.h:66
@ AuthLogin
Definition qxtsmtp_p.h:67
@ AuthCramMD5
Definition qxtsmtp_p.h:68
QStringList recipients
Definition qxtsmtp_p.h:77
SmtpState state
Definition qxtsmtp_p.h:72
QByteArray buffer
Definition qxtsmtp_p.h:74
void authLogin()
Definition qxtsmtp.cpp:388
AuthType authType
Definition qxtsmtp_p.h:73
bool useSecure
Definition qxtsmtp_p.h:71
SmtpState
Definition qxtsmtp_p.h:43
@ EhloSent
Definition qxtsmtp_p.h:46
@ EhloGreetReceived
Definition qxtsmtp_p.h:47
@ StartTLSSent
Definition qxtsmtp_p.h:51
@ MailToSent
Definition qxtsmtp_p.h:56
@ Waiting
Definition qxtsmtp_p.h:60
@ EhloDone
Definition qxtsmtp_p.h:49
@ EhloExtensionsReceived
Definition qxtsmtp_p.h:48
@ StartState
Definition qxtsmtp_p.h:45
@ Resetting
Definition qxtsmtp_p.h:61
@ AuthUsernameSent
Definition qxtsmtp_p.h:53
@ Authenticated
Definition qxtsmtp_p.h:55
@ AuthRequestSent
Definition qxtsmtp_p.h:52
@ HeloSent
Definition qxtsmtp_p.h:50
@ Disconnected
Definition qxtsmtp_p.h:44
@ AuthSent
Definition qxtsmtp_p.h:54
@ SendingBody
Definition qxtsmtp_p.h:58
@ RcptAckPending
Definition qxtsmtp_p.h:57
@ BodySent
Definition qxtsmtp_p.h:59
QxtSmtpPrivate()
Definition qxtsmtp.cpp:42
void socketRead()
Definition qxtsmtp.cpp:172
void authPlain()
Definition qxtsmtp.cpp:371
void sendNextRcpt(const QByteArray &code, const QByteArray &line)
Definition qxtsmtp.cpp:481
void socketError(QAbstractSocket::SocketError err)
Definition qxtsmtp.cpp:161
QByteArray username
Definition qxtsmtp_p.h:74
void ehlo()
Definition qxtsmtp.cpp:273
QList< QPair< int, QxtMailMessage > > pending
Definition qxtsmtp_p.h:76
QHash< QString, QString > extensions
Definition qxtsmtp_p.h:75
QSslSocket * socket
Definition qxtsmtp_p.h:81
void parseEhlo(const QByteArray &code, bool cont, const QString &line)
Definition qxtsmtp.cpp:287
The QxtSmtp class implements the SMTP protocol for sending email.
Definition qxtsmtp.h:40
#define QXT_DECLARE_PUBLIC(PUB)
Definition qxtglobal.h:146