LMTP.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. #ifndef LMTP_H
  18. #define LMTP_H
  19. #include <string>
  20. #include <vector>
  21. #include <kopano/zcdefs.h>
  22. #include <kopano/ECChannel.h>
  23. #include <kopano/ECConfig.h>
  24. enum LMTP_Command {LMTP_Command_LHLO, LMTP_Command_MAIL_FROM, LMTP_Command_RCPT_TO, LMTP_Command_DATA, LMTP_Command_RSET, LMTP_Command_QUIT };
  25. class LMTP _kc_final {
  26. public:
  27. LMTP(ECChannel *, const char *path, ECConfig *);
  28. HRESULT HrGetCommand(const std::string &strCommand, LMTP_Command &eCommand);
  29. HRESULT HrResponse(const std::string &strResponse);
  30. HRESULT HrCommandLHLO(const std::string &strInput, std::string & nameOut);
  31. HRESULT HrCommandMAILFROM(const std::string &strFrom, std::string *const strAddress);
  32. HRESULT HrCommandRCPTTO(const std::string &to_address, std::string *mail_address_unsolved);
  33. HRESULT HrCommandDATA(FILE *tmp);
  34. HRESULT HrCommandQUIT();
  35. private:
  36. HRESULT HrParseAddress(const std::string &strAddress, std::string *strEmail);
  37. ECChannel *m_lpChannel;
  38. ECConfig *m_lpConfig;
  39. std::string m_strPath;
  40. };
  41. #endif