summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mail2/libmail/smtphandler.h
Unidiff
Diffstat (limited to 'noncore/unsupported/mail2/libmail/smtphandler.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/mail2/libmail/smtphandler.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/libmail/smtphandler.h b/noncore/unsupported/mail2/libmail/smtphandler.h
new file mode 100644
index 0000000..abbcbcd
--- a/dev/null
+++ b/noncore/unsupported/mail2/libmail/smtphandler.h
@@ -0,0 +1,55 @@
1#ifndef SMTPHANDLER_H
2#define SMTPHANDLER_H
3
4#include <qobject.h>
5#include <qstring.h>
6
7#include "configfile.h"
8
9class QSocket;
10
11class SmtpHandler : public QObject
12{
13 Q_OBJECT
14
15public:
16 SmtpHandler(const QString &header, const QString &message, Account &account, const QString &to);
17
18 enum SmtpError {
19 ErrConnectionRefused,
20 ErrHostNotFound,
21 ErrUnknownResponse,
22 ErrAuthNotSupported
23 };
24
25public slots:
26 void stop();
27
28signals:
29 void finished();
30 void error(const QString &);
31 void status(const QString &);
32
33private slots:
34 void readyRead();
35 void hostFound();
36 void connected();
37 void deleteMe();
38 void errorHandling(int);
39
40private:
41 void sendToSocket(const QString &text, bool log = true);
42
43 enum State { Ehlo, Auth, ReadAuth, Helo, Mail, Rcpt,
44 Data, Body, Quit, Close };
45
46 QString _header, _message;
47 Account _account;
48 QString _to;
49 QSocket *_socket;
50 int _state;
51};
52
53#endif
54
55