vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / mail_daemon / outbound_protocols / smtp / SMTP.h
blob7af6d8a2e801aa6e6e5bd2825c54720d73d50e75
1 /*
2 * Copyright 2007-2015, Haiku Inc. All Rights Reserved.
3 * Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
4 * Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
6 * Distributed under the terms of the MIT License.
7 */
8 #ifndef SMTP_H
9 #define SMTP_H
12 #include <String.h>
14 #include <MailFilter.h>
15 #include <MailProtocol.h>
16 #include <MailSettings.h>
19 class BSocket;
22 class SMTPProtocol : public BOutboundMailProtocol {
23 public:
24 SMTPProtocol(
25 const BMailAccountSettings& settings);
26 virtual ~SMTPProtocol();
28 protected:
29 status_t Connect();
30 void Disconnect();
32 virtual status_t HandleSendMessages(const BMessage& message,
33 off_t totalBytes);
35 status_t Open(const char *server, int port, bool esmtp);
36 void Close();
37 status_t Login(const char *uid, const char *password);
38 status_t Send(const char *to, const char *from,
39 BPositionIO *message);
41 int32 ReceiveResponse(BString &line);
42 status_t SendCommand(const char *cmd);
44 private:
45 status_t _SendMessage(const entry_ref& ref);
46 status_t _POP3Authentication();
48 BSocket* fSocket;
49 BString fLog;
50 BMessage fSettingsMessage;
51 int32 fAuthType;
53 bool use_ssl;
55 status_t fStatus;
56 BString fServerName; // required for DIGEST-MD5
60 #endif // SMTP_H