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.

120 lines
4.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: envdef.h
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 01-05-96 Rohanp Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef __ENVDEF_H__
  18. #define __ENVDEF_H__
  19. #define MSG_TYPE_NDR 0x00000001 //Msg is an NDR
  20. #define MSG_TYPE_DSL 0x00000002 //Msg has a DL
  21. #define MSG_TYPE_NDE 0x00000004 //Msg is to be NDRed immediately
  22. #define MSG_TYPE_NDP 0x00000008 //NDR sent to POSTMASTER
  23. #define MSG_TYPE_RES 0x00000010 //Msg was already resolved through abook
  24. #define MSG_TYPE_EMIME 0x00000020 //Msg is 8bit mime
  25. #define MSG_TYPE_RQL 0x00000040 //Requeue this message to the sharing queue
  26. #define MSG_TYPE_LRE 0x00000080 //Local recipients were in the retry queue
  27. #define MSG_TYPE_RRE 0x00000100 //Remote recipients were in the retry queue
  28. #define MSG_TYPE_NEW 0x00000200 //Brand new message
  29. #define MSG_TYPE_SQL 0x00000400 //Reading from SQL
  30. #define MSG_TYPE_PKUP 0x00000800 //Reading from Pickup directory
  31. #define MSG_TYPE_ASYNC_RES_STARTED 0x00001000 //Async resolution started
  32. #define MSG_TYPE_ASYNC_RES_STOPPED 0x00002000 //Async resolution stopped
  33. #define MSG_TYPE_LTR_PRESENT 0x00004000 //An LTR is present before addr resolution
  34. //current version of this header
  35. #define CURRENT_HEADER_HIGH_VERSION 1
  36. #define CURRENT_HEADER_LOW_VERSION 0
  37. #define MAKESMTPVERSION(HighVersion, LowVersion) (((HighVersion) << 16) | (LowVersion))
  38. #define ENV_SIGNATURE ((DWORD)'SENV')
  39. #define IsPropertySet(Flags, Option) ((Flags & Option) == Option)
  40. enum HEADER_OFFSET {HDR_VERSION, HDR_TYPE, HDR_LOFFSET, HDR_LSIZE,
  41. HDR_ROFFSET, HDR_RSIZE, HDR_LEXP_TIME,
  42. HDR_RETRY_OFFSET, HDR_RETRY_ELEMENTS,
  43. HDR_ROUTE_SIZE, HDR_REXP_TIME};
  44. /*
  45. The envelope for each message resides in an NTFS
  46. stream in that message file. The envelope has
  47. a header that looks like the following :
  48. struct ENVELOPE_HEADER
  49. {
  50. DWORD Version; // The current version of this structure
  51. DWORD Signature; // Signature (should be 'SENV'
  52. DWORD HdrSize; // Current size of this structure
  53. DWORD BodyOffset; // Offset of the body of the message from beginning
  54. DWORD MsgFlags; // 0 if normal message, 1 if NDR message
  55. DWORD LocalOffset; // Local rcpt. list offset
  56. DWORD RemoteOffset; // Remote rcpt. list offset
  57. DWORD LocalSize; // Size of local rcpt list in bytes
  58. DWORD RemoteSize; // Size of remote rcpt list in bytes
  59. DWORD RouteStructSize; // Size of AB structure, if present
  60. LONGLONG LocalExpireTime; // Time to delete local portion of mail
  61. LONGLONG RemoteExpireTime; // To delete remote portion of mail
  62. };
  63. Right after the envelope header is the address
  64. that was in the "Mail From" line. This address
  65. is stored like "[email protected]\n". The "S"
  66. stands for SENDER. In the code below, the first
  67. byte is always removed when reading the address.
  68. The '\n' is also replaced with a '\0';
  69. In this version the Remote recipient list, if any,
  70. comes right after the senders' address. You can
  71. also find it by seeking RemoteOffset bytes from the
  72. beginning of the file. Once RemoteOffset is reached,
  73. the code reads RemoteSize bytes of data. This is the
  74. total size in bytes of the remote recipient list.
  75. Each recipient address is stored on a line by itself,
  76. with the first letter "R" as in the example below:
  77. Rrohanp@microsoft.com\n
  78. Rtoddch@microsoft.com\n
  79. etc.
  80. The local addresses have the same format. The first byte,
  81. 'R' stands for recipient and is always removed when building
  82. the address. The '\n' is also removed.
  83. */
  84. typedef struct _ENVELOPE_HEADER_
  85. {
  86. DWORD Version; // The current version of this structure
  87. DWORD Signature; // Signature (should be 'SENV'
  88. DWORD HdrSize; // Size of this header
  89. DWORD BodyOffset; // Offset of body into file
  90. DWORD MsgFlags; // Has flags noted above
  91. DWORD LocalOffset; // Local rcpt. list offset
  92. DWORD RemoteOffset; // Remote rcpt. list offset
  93. DWORD LocalSize; // Size of local rcpt list in bytes
  94. DWORD RemoteSize; // Size of remote rcpt list in bytes
  95. DWORD RouteStructSize; // Size of AB structure, if present
  96. DWORD RetryOffset; // offset of local recipients to retry
  97. DWORD RetryElements; // Size of retry list
  98. LONGLONG LocalExpireTime; // Time to delete local portion of mail
  99. LONGLONG RemoteExpireTime; // To delete remote portion of mail
  100. } ENVELOPE_HEADER, *PENV_HEADER;
  101. typedef struct _ENVELOPE_HEADER_EX_
  102. {
  103. DWORD ErrorCode;
  104. ABROUTING AbInfo; // Last address in DL we processed
  105. }ENVELOPE_HEADER_EX, *PENV_HEADER_EX;
  106. #endif