Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.3 KiB

  1. #ifndef _ASYNC_SMTPMX_HXX_
  2. #define _ASYNC_SMTPMX_HXX_
  3. class SMTP_SERVER_INSTANCE;
  4. #define SMTP_ASYNCMX_SIGNATURE 'uDNS'
  5. #define SMTP_ASYNCMX_SIGNATURE_FREE 'fDNS'
  6. class RETRYPARAMS
  7. {
  8. public:
  9. IMailMsgProperties *m_pIMsg;
  10. PVOID m_pAdvQContext;
  11. DWORD m_dwNumRcpts;
  12. PDWORD m_pRcptIdxList;
  13. RETRYPARAMS()
  14. {
  15. m_pIMsg = NULL;
  16. m_pAdvQContext = NULL;
  17. m_dwNumRcpts = 0;
  18. m_pRcptIdxList = NULL;
  19. }
  20. };
  21. class CAsyncSmtpDns : public CAsyncMxDns
  22. {
  23. private:
  24. DWORD m_Signature;
  25. DWORD m_DomainOptions;
  26. BOOL m_fConnectToSmartHost;
  27. SMTP_SERVER_INSTANCE *m_pServiceInstance;
  28. ISMTPConnection *m_pISMTPConnection;
  29. DNS_RESOLVER_RECORD *m_pDNS_RESOLVER_RECORD;
  30. LPSTR m_pszSSLVerificationName;
  31. BOOL m_fInitCalled;
  32. DWORD m_dwDiagnostic;
  33. RETRYPARAMS m_RetryParams;
  34. public:
  35. //use CPool for better memory management
  36. static CPool Pool;
  37. // override the mem functions to use CPool functions
  38. void *operator new (size_t cSize)
  39. { return Pool.Alloc(); }
  40. void operator delete (void *pInstance)
  41. { Pool.Free(pInstance); }
  42. CAsyncSmtpDns (
  43. SMTP_SERVER_INSTANCE * pServiceInstance,
  44. ISMTPConnection *pSmtpConnection,
  45. RETRYPARAMS *pRetryParams,
  46. char *MyFQDN);
  47. ~CAsyncSmtpDns();
  48. LIST_ENTRY m_ListEntry;
  49. LIST_ENTRY & QueryListEntry(void) {return m_ListEntry;}
  50. BOOL Init (LPSTR pszSSLVerificationName);
  51. void SetDomainOptions(DWORD Options) {m_DomainOptions = Options;}
  52. void SetSmartHostOption(BOOL fConnectToSmartHost) {m_fConnectToSmartHost = fConnectToSmartHost;}
  53. BOOL NDRAllMessages();
  54. void SetDnsResolverRecord(DNS_RESOLVER_RECORD *pDnsResolverRecord)
  55. { m_pDNS_RESOLVER_RECORD = pDnsResolverRecord; }
  56. PVOID QueryInstance() { return m_pServiceInstance; }
  57. BOOL RetryAsyncDnsQuery(BOOL fUdp);
  58. void HandleCompletedData(DNS_STATUS);
  59. BOOL IsShuttingDown();
  60. BOOL IsAddressMine(DWORD dwIp);
  61. };
  62. #endif