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.

137 lines
3.3 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. smtpdata.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 SMTP_UNRECOG_COMMAND_CODE 500
  21. #define SMTP_SYNTAX_ERROR_CODE 501
  22. #define SMTP_NOT_IMPLEMENTED_CODE 502
  23. #define SMTP_BAD_SEQUENCE_CODE 503
  24. #define SMTP_PARAM_NOT_IMPLEMENTED_CODE 504
  25. #define SMTP_SYS_STATUS_CODE 211
  26. #define SMTP_SERVICE_CLOSE_CODE 221
  27. #define SMTP_SERVICE_READY_CODE 220
  28. #define SMTP_OK_CODE 250
  29. #define SMTP_USER_NOT_LOCAL_CODE 251
  30. #define SMTP_MBOX_BUSY_CODE 450
  31. #define SMTP_MBOX_NOTFOUND_CODE 550
  32. #define SMTP_ERROR_PROCESSING_CODE 451
  33. #define SMTP_USERNOTLOCAL_CODE 551
  34. #define SMTP_INSUFF_STORAGE_CODE 452
  35. #define SMTP_ACTION_ABORTED_CODE 552
  36. #define SMTP_ACTION_NOT_TAKEN_CODE 553
  37. #define SMTP_START_MAIL_CODE 354
  38. #define SMTP_TRANSACT_FAILED_CODE 554
  39. #define SMTP_SERVICE_UNAVAILABLE_CODE 421
  40. #define SMTP_COMPLETE_FAILURE_DWORD 5
  41. enum RCPTYPE{LOCAL_NAME, REMOTE_NAME, ALIAS_NAME};
  42. #define NORMAL_RCPT (char)'R'
  43. #define ERROR_RCPT (char)'E'
  44. //
  45. // use the current command for transaction logging
  46. //
  47. #define USE_CURRENT 0xFFFFFFFF
  48. static const char * LOCAL_TRANSCRIPT = "ltr";
  49. static const char * REMOTE_TRANSCRIPT = "rtr";
  50. static const char * ALIAS_EXT = "dl";
  51. #define ISNULLADDRESS(Address) ((Address[0] == '<') && (Address[1] == '>'))
  52. typedef char RCPT_TYPE;
  53. //
  54. // Statistics
  55. //
  56. extern SMTP_STATISTICS_0 g_SmtpStat;
  57. extern SMTPCONFIG * g_SmtpConfig;
  58. extern TIME_ZONE_INFORMATION tzInfo;
  59. extern PERSIST_QUEUE * g_LocalQ;
  60. extern PERSIST_QUEUE * g_RemoteQ;
  61. extern BOOL g_IsShuttingDown;
  62. extern BOOL g_QIsShuttingDown;
  63. extern BOOL g_RetryQIsShuttingDown;
  64. #define INITIALIZE_INBOUNDPOOL 0x00000001
  65. #define INITIALIZE_OUTBOUNDPOOL 0x00000002
  66. #define INITIALIZE_ADDRESSPOOL 0x00000004
  67. #define INITIALIZE_MAILOBJPOOL 0x00000008
  68. #define INITIALIZE_CBUFFERPOOL 0x00000010
  69. #define INITIALIZE_CIOBUFFPOOL 0x00000020
  70. extern DWORD g_SmtpInitializeStatus;
  71. #define BUMP_COUNTER(counter) \
  72. InterlockedIncrement((LPLONG) &(g_SmtpStat. counter))
  73. #define DROP_COUNTER(counter) \
  74. InterlockedDecrement((LPLONG) &(g_SmtpStat. counter))
  75. #define ADD_COUNTER(counter, value) \
  76. INTERLOCKED_ADD_CHEAP(&(g_SmtpStat. counter), value)
  77. #define ADD_BIGCOUNTER(counter, value) \
  78. INTERLOCKED_BIGADD_CHEAP(&(g_SmtpStat. counter), value)
  79. /*++
  80. Returns a UniqueFilename for an e-mail message.
  81. The caller should loop through this call and a call to
  82. CreateFile with the CREATE_NEW flag. If the Create fails due
  83. to YYY, then the caller should loop again.
  84. Arguments:
  85. psz - a buffer
  86. pdw - IN the size of the buffer,
  87. OUT: the size of the buffer needed (error == ERROR_MORE_DATA)
  88. or the size of the filename.
  89. Returns:
  90. TRUE on SUCCESS
  91. FALSE if buffer isn't big enough.
  92. --*/
  93. BOOL GetUniqueFilename(
  94. IN OUT LPTSTR psz,
  95. IN OUT LPDWORD pdw
  96. );
  97. #endif // _SMTPDATA_