Source code of Windows XP (NT5)
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.

223 lines
6.5 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. globals.h
  5. Abstract:
  6. This module contains declarations for globals.
  7. Author:
  8. Johnson Apacible (JohnsonA) 26-Sept-1995
  9. Revision History:
  10. --*/
  11. #ifndef _SMTPDATA_
  12. #define _SMTPDATA_
  13. //
  14. // tracing
  15. //
  16. #define INIT_TRACE InitAsyncTrace( )
  17. #define TERM_TRACE TermAsyncTrace( )
  18. #define ENTER( _x_ ) TraceFunctEnter( _x_ );
  19. #define LEAVE TraceFunctLeave( );
  20. #define DOMAIN_ROUTE_HT_SIGNATURE_VALID 'DRHV'
  21. #define DOMAIN_ROUTE_HT_SIGNATURE_FREE 'DRHF'
  22. #define LOCAL_DOMAIN_HT_SIGNATURE_VALID 'LDHV'
  23. #define LOCAL_DOMAIN_HT SIGNATURE_FREE 'LDHF'
  24. #define DEDICATED_CLIENT_REQUEST_THREADS 3
  25. #define SYSTEM_ROUTING_THREADS_PER_PROC 12
  26. #define CHECK_QUEUE_COUNT 50
  27. #define ADD_THREAD_BACKLOG 100
  28. #define SMTP_BASE_PRODUCT (0)
  29. #define SMTP_UNRECOG_COMMAND_CODE 500
  30. #define SMTP_SYNTAX_ERROR_CODE 501
  31. #define SMTP_NOT_IMPLEMENTED_CODE 502
  32. #define SMTP_BAD_SEQUENCE_CODE 503
  33. #define SMTP_PARAM_NOT_IMPLEMENTED_CODE 504
  34. #define SMTP_SYS_STATUS_CODE 211
  35. #define SMTP_SERVICE_CLOSE_CODE 221
  36. #define SMTP_SERVICE_READY_CODE 220
  37. #define SMTP_OK_CODE 250
  38. #define SMTP_USER_NOT_LOCAL_CODE 251
  39. #define SMTP_MBOX_BUSY_CODE 450
  40. #define SMTP_MBOX_NOTFOUND_CODE 550
  41. #define SMTP_ERROR_PROCESSING_CODE 451
  42. #define SMTP_USERNOTLOCAL_CODE 551
  43. #define SMTP_INSUFF_STORAGE_CODE 452
  44. #define SMTP_ACTION_ABORTED_CODE 552
  45. #define SMTP_ACTION_NOT_TAKEN_CODE 553
  46. #define SMTP_START_MAIL_CODE 354
  47. #define SMTP_TRANSACT_FAILED_CODE 554
  48. #define SMTP_SERVICE_UNAVAILABLE_CODE 421
  49. #define SMTP_COMPLETE_FAILURE_DWORD 5
  50. enum RCPTYPE{LOCAL_NAME, REMOTE_NAME, ALIAS_NAME};
  51. #define NORMAL_RCPT (char)'R'
  52. #define ERROR_RCPT (char)'E'
  53. //
  54. // use the current command for transaction logging
  55. //
  56. #define USE_CURRENT 0xFFFFFFFF
  57. static const char * LOCAL_TRANSCRIPT = "ltr";
  58. static const char * REMOTE_TRANSCRIPT = "rtr";
  59. static const char * ALIAS_EXT = "dl";
  60. #define ISNULLADDRESS(Address) ((Address[0] == '<') && (Address[1] == '>'))
  61. typedef char RCPT_TYPE;
  62. extern SMTP_STATISTICS_0 g_pSmtpStat;
  63. extern LPSMTP_SERVER_STATISTICS g_pSmtpStats;
  64. extern TIME_ZONE_INFORMATION tzInfo;
  65. extern CHAR g_ComputerName[];
  66. extern CHAR g_VersionString[];
  67. extern DWORD g_ComputerNameLength;
  68. extern DWORD g_LoopBackAddr;
  69. extern DWORD g_ProductType;
  70. extern DWORD g_NumProcessors;
  71. extern DWORD g_PickupWait;
  72. extern LONG g_MaxFindThreads;
  73. extern PLATFORM_TYPE g_SmtpPlatformType;
  74. extern CEventLogWrapper g_EventLog;
  75. extern "C"
  76. {
  77. extern BOOL g_IsShuttingDown;
  78. }
  79. #define INITIALIZE_INBOUNDPOOL 0x00000001
  80. #define INITIALIZE_OUTBOUNDPOOL 0x00000002
  81. #define INITIALIZE_ADDRESSPOOL 0x00000004
  82. #define INITIALIZE_MAILOBJPOOL 0x00000008
  83. #define INITIALIZE_CBUFFERPOOL 0x00000010
  84. #define INITIALIZE_CIOBUFFPOOL 0x00000020
  85. #define INITIALIZE_SSLCONTEXT 0x00000040
  86. #define INITIALIZE_ETRNENTRYPOOL 0x00000080
  87. #define INITIALIZE_CSECURITY 0x00000100
  88. #define INITIALIZE_CPROPERTYBAGPOOL 0x00000200
  89. #define INITIALIZE_CASYNCMX 0x00000400
  90. #define INITIALIZE_CASYNCDNS 0x00000800
  91. #define INITIALIZE_CBLOCKMGR 0x00001000
  92. #define INITIALIZE_FILEHC 0x00002000
  93. #define INITIALIZE_CDROPDIR 0x00004000
  94. extern DWORD g_SmtpInitializeStatus;
  95. //Domain validation flags
  96. #define SMTP_NOVALIDATE_EHLO 0x00000001
  97. #define SMTP_NOVALIDATE_MAIL 0x00000002
  98. #define SMTP_NOVALIDATE_RCPT 0x00000004
  99. #define SMTP_NOVALIDATE_PKUP 0x00000008
  100. #define SMTP_NOVALIDATE_ETRN 0x00000010
  101. #define BUMP_COUNTER(InstObj, counter) \
  102. InterlockedIncrement((LPLONG) &(InstObj->QueryStatsObj()->QueryStatsMember()->counter))
  103. #define DROP_COUNTER(InstObj, counter) \
  104. InterlockedDecrement((LPLONG) &(InstObj->QueryStatsObj()->QueryStatsMember()->counter))
  105. #define ADD_COUNTER(InstObj, counter, value) \
  106. INTERLOCKED_ADD_CHEAP(&(InstObj->QueryStatsObj()->QueryStatsMember()->counter), value)
  107. #define ADD_BIGCOUNTER(InstObj, counter, value) \
  108. INTERLOCKED_BIGADD_CHEAP(&(InstObj->QueryStatsObj()->QueryStatsMember()->counter), value)
  109. /***********************************************************
  110. * Type Definitions
  111. ************************************************************/
  112. const DWORD MAX_RESPONSE_LEN = 300;
  113. const DWORD RESPONSE_BUFF_SIZE = MAX_RESPONSE_LEN + MAX_PATH;
  114. const DWORD cMaxRoutingSources = 32;
  115. const DWORD cbMaxRoutingSource = 512;
  116. const DWORD smarthostNone = 0;
  117. const DWORD smarthostAfterFail = 1;
  118. const DWORD smarthostAlways = 2;
  119. // Removed by KeithLau on 7/18/96
  120. // const DWORD cMaxValidDomains = 32;
  121. #define SMTP_WRITE_BUFFER_SIZE ( 64 * 1024 ) //64K buffers
  122. enum SMTP_MSG_FILE_TYPE {SYSTEM_MSG_FILE, LOCAL_MSG_FILE, ABOOK_MSG_FILE};
  123. enum SMTPCMDSEX {
  124. #undef SmtpDef
  125. #define SmtpDef(a) CMD_EX_##a,
  126. #include "smtpdef.h"
  127. CMD_EX_UNKNOWN
  128. };
  129. enum SMTPLOGS {
  130. #undef SmtpDef
  131. #define SmtpDef(a) LOG_FLAG_##a = (1<<CMD_EX_##a),
  132. #include "smtpdef.h"
  133. LOG_FLAG_UNKNOWN = (1<<CMD_EX_UNKNOWN)
  134. };
  135. #define DEFAULT_CMD_LOG_FLAGS LOG_FLAG_HELO | \
  136. LOG_FLAG_EHLO | \
  137. LOG_FLAG_MAIL | \
  138. LOG_FLAG_RCPT | \
  139. LOG_FLAG_DATA | \
  140. LOG_FLAG_QUIT | \
  141. LOG_FLAG_ETRN | \
  142. LOG_FLAG_VRFY | \
  143. LOG_FLAG_STARTTLS |\
  144. LOG_FLAG_AUTH |\
  145. LOG_FLAG_TURN |\
  146. LOG_FLAG_BDAT |\
  147. LOG_FLAG_UNKNOWN
  148. /*++
  149. Returns a UniqueFilename for an e-mail message.
  150. The caller should loop through this call and a call to
  151. CreateFile with the CREATE_NEW flag. If the Create fails due
  152. to YYY, then the caller should loop again.
  153. Arguments:
  154. psz - a buffer
  155. pdw - IN the size of the buffer,
  156. OUT: the size of the buffer needed (error == ERROR_MORE_DATA)
  157. or the size of the filename.
  158. Returns:
  159. TRUE on SUCCESS
  160. FALSE if buffer isn't big enough.
  161. --*/
  162. BOOL GetUniqueFilename(
  163. IN OUT LPTSTR psz,
  164. IN OUT LPDWORD pdw
  165. );
  166. BOOL CreateLayerDirectory( char * str );
  167. #define RESOLUTION_UNCACHEDDNS 0x00000001
  168. #define RESOLUTION_GETHOSTBYNAME 0x00000002
  169. #define RESOULTION_DNS_GETHOSTBYNAME 0x00000003
  170. #endif // _SMTPDATA_