123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- #ifndef POP3_H
- #define POP3_H
- #include <vector>
- #include <kopano/zcdefs.h>
- #include "ClientProto.h"
- #define POP3_MAX_RESPONSE_LENGTH 512
- #define POP3_RESP_OK "+OK "
- #define POP3_RESP_TEMPFAIL "-ERR [SYS/TEMP] "
- #define POP3_RESP_PERMFAIL "-ERR [SYS/PERM] "
- #define POP3_RESP_AUTH_ERROR "-ERR [AUTH] "
- #define POP3_RESP_ERR "-ERR "
- class POP3 _kc_final : public ClientProto {
- public:
- POP3(const char *szServerPath, ECChannel *lpChannel, ECLogger *lpLogger, ECConfig *lpConfig);
- ~POP3();
- int getTimeoutMinutes();
- HRESULT HrSendGreeting(const std::string &strHostString);
- HRESULT HrCloseConnection(const std::string &strQuitMsg);
- HRESULT HrProcessCommand(const std::string &strInput);
- HRESULT HrDone(bool bSendResponse);
- private:
- std::string GetCapabilityString();
- HRESULT HrCmdCapability();
- HRESULT HrCmdStarttls();
- HRESULT HrCmdUser(const std::string &strUser);
- HRESULT HrCmdPass(const std::string &strPass);
- HRESULT HrCmdStat();
- HRESULT HrCmdList();
- HRESULT HrCmdList(unsigned int ulMailNr);
- HRESULT HrCmdRetr(unsigned int ulMailNr);
- HRESULT HrCmdDele(unsigned int ulMailNr);
- HRESULT HrCmdNoop();
- HRESULT HrCmdRset();
- HRESULT HrCmdQuit();
- HRESULT HrCmdUidl();
- HRESULT HrCmdUidl(unsigned int ulMailNr);
- HRESULT HrCmdTop(unsigned int ulMailNr, unsigned int ulLines);
- HRESULT HrResponse(const std::string &strResult, const std::string &strResponse);
- struct MailListItem {
- SBinary sbEntryID;
- ULONG ulSize;
- bool bDeleted;
- };
- HRESULT HrMakeMailList();
- HRESULT HrLogin(const std::string &strUsername, const std::string &strPassword);
- std::string DotFilter(const char *input);
- BOOL IsAuthorized() { return !!lpStore; }
- IMAPISession *lpSession = nullptr;
- IMsgStore *lpStore = nullptr;
- IMAPIFolder *lpInbox = nullptr;
- IAddrBook *lpAddrBook = nullptr;
- sending_options sopt;
- std::string szUser;
- std::vector<MailListItem> lstMails;
- };
- #endif
|