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.

502 lines
22 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. //
  4. // File: aqueue.idl
  5. //
  6. // Description: IDL source for aqueue.dll. Contains interface descriptions
  7. // for:
  8. // IAdvQueue
  9. // Exposes SubmitMessage via server event as well
  10. // as HandleFailedMessage.
  11. // IAdvQueueConfig
  12. // Allows SMTP service to configure AQ
  13. // IConnectionManager
  14. // Interface to SMTP for outbound connections
  15. // IAdvQueueDomainType
  16. // Interface passed to the default categorizer that
  17. // allows it to check if a domain is local or not.
  18. //
  19. // Author: mikeswa
  20. //
  21. // History:
  22. // 7/28/98 - MikeSwa Modified - added IAdvQueueDomainType and
  23. // HandleFailedMessage
  24. // 6/7/99 - MikeSwa Removed queue admin interface
  25. // Copyright (C) 1997 Microsoft Corporation
  26. //
  27. //-----------------------------------------------------------------------------
  28. import "oaidl.idl";
  29. import "ocidl.idl";
  30. import "mailmsg.idl";
  31. import "smtpevent.idl";
  32. import "perfcat.h";
  33. // Include aqdll.h to define the dll and function names and prototypes
  34. cpp_quote("#include \"aqdll.h\" ")
  35. //---[ eMessageStatus ]--------------------------------------------------------
  36. //
  37. //
  38. // Description: enum used to describe Message status on
  39. // ISMTPConnection::AckMessage
  40. //
  41. //-----------------------------------------------------------------------------
  42. typedef [v1_enum] enum
  43. {
  44. MESSAGE_STATUS_ALL_DELIVERED = 0x00000001, //everything succeed
  45. MESSAGE_STATUS_RETRY = 0x00000002, //need to retry message
  46. MESSAGE_STATUS_CHECK_RECIPS = 0x00000004, //send message through dsn code
  47. MESSAGE_STATUS_NDR_ALL = 0x00000008, //delivery failed -- NDR all recips
  48. MESSAGE_STATUS_DSN_NOT_SUPPORTED = 0x00000010, //remote system does not support DSN's
  49. MESSAGE_STATUS_EXTENDED_STATUS_CODES = 0x00000020, //Extended status codes returned
  50. MESSAGE_STATUS_RESERVED = 0xFF000000, //reserved for internal use
  51. } eMessageStatus ;
  52. cpp_quote("#define MESSAGE_STATUS_RETRY_ALL 0x00000002") //*** OBSOLETE ***
  53. //---[ eConnectionStatus ]-----------------------------------------------------
  54. //
  55. //
  56. // Description: enum used to describe connection status on
  57. // ISMTPConnection::AckConnection
  58. //
  59. //-----------------------------------------------------------------------------
  60. typedef [v1_enum] enum
  61. {
  62. CONNECTION_STATUS_OK = 0x00000000,
  63. CONNECTION_STATUS_FAILED = 0x00000001, //Initial Connection failed
  64. CONNECTION_STATUS_DROPPED = 0x00000002, //Initial Connection succeeded, but was later dropped
  65. CONNECTION_STATUS_FAILED_NDR_UNDELIVERED = 0x00000004, //NDR undelivered recipients
  66. CONNECTION_STATUS_FAILED_LOOPBACK = 0x00000010, //Connection configured as loop
  67. } eConnectionStatus ;
  68. //---[ eDomainInfoFlags ]------------------------------------------------------
  69. //
  70. // Description: Flags used to describe boolean per domain properties
  71. // See smtpevent.idl for the definition of the domain info flags.
  72. //
  73. //-----------------------------------------------------------------------------
  74. //---[ DomainInfo ]------------------------------------------------------------
  75. //
  76. //
  77. // Description: Struct passed back by ISMTPConnection::GetDomainInfo
  78. // (string size does not include '\0'). Also used to set per-domain
  79. // properties.
  80. //
  81. // String values that are returned in proc via GetDomainInfo will be
  82. // valid while the connection exists.
  83. //
  84. //-----------------------------------------------------------------------------
  85. typedef struct _DomainInfo
  86. {
  87. DWORD cbVersion; //version / size of info struct
  88. DWORD dwDomainInfoFlags; //OR'd eDomainInfoFlags
  89. DWORD cbDomainNameLength;
  90. LPSTR szDomainName; //Domain Name this info references
  91. DWORD cbETRNDomainNameLength;
  92. LPSTR szETRNDomainName; //Domain Name to send with ETRN
  93. DWORD cbSmartHostDomainNameLength;
  94. LPSTR szSmartHostDomainName; //Domain Name to connect as
  95. DWORD cbDropDirectoryLength;
  96. LPSTR szDropDirectory; //Directory to drop to
  97. DWORD cbAuthTypeLength;
  98. LPSTR szAuthType; //Arbitrary auth type string
  99. DWORD cbUserNameLength;
  100. LPSTR szUserName; //User name to authenticate with
  101. DWORD cbPasswordLength;
  102. LPSTR szPassword; //Password to authenticate with
  103. DWORD cEtrnDelayTime; //Delay between making connection and sending ETRN
  104. DWORD cbBlob;
  105. DWORD *pvBlob; //Blob associated with domain (used in relay restrictions)
  106. } DomainInfo ;
  107. //---[ eAQConfigInfoFlags ]----------------------------------------------------
  108. //
  109. //
  110. // Description: Flags describing which AQConfigInfo parameters to use (are
  111. // updated)
  112. //
  113. //-----------------------------------------------------------------------------
  114. typedef [v1_enum] enum
  115. {
  116. AQ_CONFIG_INFO_MAX_CON = 0x00000001, //Use cMaxConnections
  117. AQ_CONFIG_INFO_MAX_LINK = 0x00000002, //Use cMaxLinkConnections
  118. AQ_CONFIG_INFO_MIN_MSG = 0x00000004, //Use cMinMessagesPerConnection
  119. AQ_CONFIG_INFO_CON_WAIT = 0x00000008, //Use dwConnectionWaitMilliseconds
  120. AQ_CONFIG_INFO_CON_RETRY = 0x00000010, //Use dwConnectionWaitMilliseconds
  121. AQ_CONFIG_INFO_MSGCAT_DOMAIN = 0x00000020, //Use szMsgCatDomain
  122. AQ_CONFIG_INFO_MSGCAT_USER = 0x00000040, //Use szMsgCatUser
  123. AQ_CONFIG_INFO_MSGCAT_PASSWORD = 0x00000080, //Use szMsgCatPassword
  124. AQ_CONFIG_INFO_MSGCAT_BINDTYPE = 0x00000100, //Use szMsgCatBindType
  125. AQ_CONFIG_INFO_MSGCAT_SCHEMATYPE = 0x00000200, //Use szMsgCatSchemaType
  126. AQ_CONFIG_INFO_MSGCAT_HOST = 0x00000400, //Use szMsgCatHost
  127. AQ_CONFIG_INFO_MSGCAT_FLAGS = 0x00000800, //Use dwMsgCatFlags
  128. AQ_CONFIG_INFO_MSGCAT_NAMING_CONTEXT = 0x00001000, //Use szMsgCatNamingContext
  129. AQ_CONFIG_INFO_MSGCAT_TYPE = 0x00002000, //Use szMsgCatType
  130. AQ_CONFIG_INFO_MSGCAT_PORT = 0x00004000, //Use dwMsgCatPort
  131. AQ_CONFIG_INFO_EXPIRE_DELAY = 0x00008000, //Use dwDelayExpireMinutes
  132. AQ_CONFIG_INFO_EXPIRE_NDR = 0x00010000, //Use dwNDRExpireMinutes
  133. AQ_CONFIG_INFO_LOCAL_EXPIRE_DELAY = 0x00020000, //Use dwLocalDelayExpireMinutes
  134. AQ_CONFIG_INFO_LOCAL_EXPIRE_NDR = 0x00040000, //Use dwLocalNDRExpireMinutes
  135. AQ_CONFIG_INFO_DEFAULT_DOMAIN = 0x00080000, //Use szDefaultLocalDomain
  136. AQ_CONFIG_INFO_BADMAIL_DIR = 0x00100000, //Use szBadMailDir
  137. AQ_CONFIG_INFO_USE_DSN_OPTIONS = 0x00200000, //Use dwDSNOptions
  138. AQ_CONFIG_INFO_USE_DSN_LANGUAGE = 0x00400000, //Use dwDSNLanguageID
  139. AQ_CONFIG_INFO_MSGCAT_ENABLE = 0x00800000, //Use dwMsgCatEnable
  140. AQ_CONFIG_INFO_SEND_DSN_TO = 0x01000000, //Use send NDR to address
  141. AQ_CONFIG_INFO_MSGCAT_DEFAULT = 0x02000000, //Use defaults if params not set
  142. AQ_CONFIG_INFO_SERVER_FQDN = 0x04000000, //Use server FQDN
  143. AQ_CONFIG_INFO_ALL = 0x07FFFFFF, //Use all Fields
  144. } eAQConfigInfoFlags ;
  145. //---[ eDSNOptions ]-----------------------------------------------------------
  146. //
  147. //
  148. // Description:
  149. // Options flags for DSN options passed into AQueue.
  150. //
  151. //-----------------------------------------------------------------------------
  152. typedef [v1_enum] enum
  153. {
  154. DSN_OPTIONS_DEFAULT = 0x00000000,
  155. DSN_OPTIONS_DEFAULT_RET_HEADERS = 0x00000001,
  156. DSN_OPTIONS_DEFAULT_RET_FULL = 0x00000002,
  157. DSN_OPTIONS_IGNORE_MSG_RET = 0x00000004,
  158. DSN_OPTIONS_SEND_DELAY_DEFAULT = 0x00000008,
  159. DSN_OPTIONS_SEND_DELAY_UPON_REQUEST = 0x00000010,
  160. DSN_OPTIONS_SEND_DELAY_NEVER = 0x00000020,
  161. } eDSNOptions;
  162. //---[ AQConfigInfo ]----------------------------------------------------------
  163. //
  164. //
  165. // Description: Struct containing all dynamically set-able global AQ
  166. // properties
  167. //
  168. //-----------------------------------------------------------------------------
  169. typedef struct _AQConfigInfo
  170. {
  171. DWORD cbVersion; //version / size of into struct
  172. DWORD dwAQConfigInfoFlags; //Flags describing which info to update
  173. DWORD cMaxConnections; //Total maximum Connections
  174. DWORD cMaxLinkConnections; //Total number of connections per link
  175. DWORD cMinMessagesPerConnection; //Minimum # of message before creating
  176. //*additional* connection
  177. DWORD dwConnectionWaitMilliseconds; //# of milliseconds to in
  178. //GetNextConnection, before timing out and
  179. //retrying link objects
  180. DWORD dwConnectionRetryMilliseconds; //# of milliseconds wwait before
  181. //retrying failed connections
  182. DWORD dwRetryThreshold; //# of connections failures before we start
  183. DWORD dwFirstRetrySeconds; //Interval to hold when retrying for first time
  184. DWORD dwSecondRetrySeconds; //Interval to hold when retrying for second time
  185. DWORD dwThirdRetrySeconds; //Interval to hold when retrying for third time
  186. DWORD dwFourthRetrySeconds; //Interval to hold when retrying more than three times
  187. //credentials & config into used by MsgCat to athenticate against DS
  188. LPSTR szMsgCatDomain;
  189. LPSTR szMsgCatUser;
  190. LPSTR szMsgCatPassword;
  191. LPSTR szMsgCatBindType;
  192. LPSTR szMsgCatSchemaType;
  193. LPSTR szMsgCatHost;
  194. DWORD dwMsgCatPort;
  195. DWORD dwMsgCatFlags;
  196. DWORD dwMsgCatEnable;
  197. LPSTR szMsgCatNamingContext;
  198. LPSTR szMsgCatType;
  199. //Expiry information
  200. DWORD dwDelayExpireMinutes;
  201. DWORD dwNDRExpireMinutes;
  202. DWORD dwLocalDelayExpireMinutes;
  203. DWORD dwLocalNDRExpireMinutes;
  204. //Default local domain information
  205. LPSTR szDefaultLocalDomain;
  206. //Badmail handling
  207. LPSTR szBadMailDir;
  208. //DSN Configuration
  209. DWORD dwDSNOptions;
  210. DWORD dwDSNLanguageID;
  211. LPSTR szSendCopyOfNDRToAddress;
  212. LPSTR szServerFQDN;
  213. } AQConfigInfo;
  214. //---[ MessageAck ]------------------------------------------------------------
  215. //
  216. //
  217. // Description: Struct passed back with message acks.
  218. //
  219. //
  220. //-----------------------------------------------------------------------------
  221. typedef struct _MessageAck
  222. {
  223. IMailMsgProperties *pIMailMsgProperties; //IMailMsgProperties to Ack
  224. DWORD *pvMsgContext; //Context generated on GetNextMessage
  225. DWORD dwMsgStatus; //eMsgStatus flags
  226. DWORD dwStatusCode; //The DWORD version of the status code
  227. DWORD cbExtendedStatus; //size of extended status string
  228. LPSTR szExtendedStatus; //extended status -- valid only when
  229. //MESSAGE_STATUS_EXTENDED_STATUS_CODES is set
  230. } MessageAck ;
  231. //---[ eMessageFailureReasons ]------------------------------------------------
  232. //
  233. //
  234. // Description:
  235. // Enum describing the possible SMTP message failure reasons.
  236. //
  237. //-----------------------------------------------------------------------------
  238. typedef [v1_enum] enum
  239. {
  240. MESSAGE_FAILURE_GENERAL = 0x00000001,
  241. MESSAGE_FAILURE_HOP_COUNT_EXCEEDED = 0x00000002, //Hop count on message exceeds max
  242. MESSAGE_FAILURE_BAD_PICKUP_DIR_FILE = 0x00000003, //Unable to process pickup dir file
  243. } eMessageFailureReasons;
  244. //---[ ISMTPConnection ]-------------------------------------------------------
  245. //
  246. //
  247. // Description: Interface used by SMTP to represent a single outbound
  248. // connection.
  249. //
  250. //
  251. //-----------------------------------------------------------------------------
  252. [
  253. object,
  254. local,
  255. uuid(838258A5-4EEB-11D1-B2CD-00C04FC32984),
  256. helpstring("ISMTPConnection Interface"),
  257. pointer_default(unique)
  258. ]
  259. interface ISMTPConnection : IUnknown
  260. {
  261. [helpstring("method AckConnection")] HRESULT AckConnection(
  262. [in] DWORD dwConnectionStatus);
  263. [helpstring("method GetDomainInfo")] HRESULT GetDomainInfo(
  264. [in, out] DomainInfo *pDomainInfo);
  265. [helpstring("method GetNextMessage")] HRESULT GetNextMessage(
  266. [out] IMailMsgProperties **ppIMailMsgProperties,
  267. [out] DWORD **ppvMsgContext,
  268. [in, out] DWORD *pcIndexes,
  269. [out, size_is(*pcIndexes)] DWORD *prgdwRecipIndex[]);
  270. [helpstring("method AckMessage")] HRESULT AckMessage(
  271. [in] MessageAck *pMsgAck);
  272. [helpstring("method SetDiagnosticInfo")] HRESULT SetDiagnosticInfo(
  273. [in] HRESULT hrDiagnosticError,
  274. [in, string] LPCSTR szDiagnosticVerb,
  275. [in, string] LPCSTR szDiagnosticResponse);
  276. };
  277. //---[ IConnectionManager ]----------------------------------------------------
  278. //
  279. //
  280. // Description: Interface used by SMTP to Get outbound connections and
  281. // to handle TURN, ETRN, and ATRN requests
  282. //
  283. //
  284. //-----------------------------------------------------------------------------
  285. [
  286. object,
  287. local,
  288. uuid(B198B19B-C346-11d1-A67D-00C04FA3490A),
  289. helpstring("IConnectionManager Interface"),
  290. pointer_default(unique)
  291. ]
  292. interface IConnectionManager : IUnknown
  293. {
  294. //method that waits until an outbound connection can be created
  295. [helpstring("method GetNextConnection")] HRESULT GetNextConnection(
  296. [out, retval] ISMTPConnection **ppISMTPConnection);
  297. //Used to get a connection for TURN and ATRN. The domain must be
  298. //configured as TURN or ATRN.
  299. [helpstring("method GetNamedConnection")] HRESULT GetNamedConnection(
  300. [in] DWORD cbSMTPDomain,
  301. [in, size_is(cbSMTPDomain + 1)] CHAR szSMTPDomain[],
  302. [out] ISMTPConnection **ppISMTPConnection);
  303. //Used to release threads waiting in GetNextConnection for shutdown
  304. [helpstring("method ReleaseWaitingThreads")] HRESULT ReleaseWaitingThreads();
  305. //Used to request that a connection be created in GetNextConnection
  306. //for the given domain. The domain must be configured as an ETRN
  307. //domain.
  308. [helpstring("method ETRNDomain")] HRESULT ETRNDomain(
  309. [in] DWORD cbSMTPDomain,
  310. [in, size_is(cbSMTPDomain + 1)] CHAR szSMTPDomain[],
  311. [out] DWORD *pcMessages);
  312. };
  313. //---[ IConnectionPropertyManagement ]-----------------------------------------
  314. //
  315. //
  316. // Description: Interface used by SMTP to manage properties that come from
  317. // and need to be promoted to queuing.
  318. //
  319. //-----------------------------------------------------------------------------
  320. [
  321. object,
  322. local,
  323. uuid(C6E71C06-69EB-49bb-8C30-174AF798B0EE),
  324. helpstring("IConnectionManager Interface"),
  325. pointer_default(unique)
  326. ]
  327. interface IConnectionPropertyManagement : IUnknown
  328. {
  329. //method that copies queue properties to a connection session object
  330. [helpstring("method CopyQueuePropertiesToSession")]
  331. HRESULT CopyQueuePropertiesToSession(
  332. [in] IUnknown *pISession);
  333. //method that copies session properties to queuing
  334. [helpstring("method CopySessionPropertiesToQueue")]
  335. HRESULT CopySessionPropertiesToQueue(
  336. [in] IUnknown *pISession);
  337. };
  338. //---[ IAdvQueue ]-------------------------------------------------------------
  339. //
  340. //
  341. // Description: Public interface that exposes servier-wide SubmitMessage
  342. // (eventually through a server event). For MM1, both SMTP an the MAPI
  343. // driver will use this to queueu messages for delivery,
  344. //
  345. //
  346. //-----------------------------------------------------------------------------
  347. [
  348. object,
  349. uuid(838258A9-4EEB-11D1-B2CD-00C04FC32984),
  350. helpstring("IAdvQueue Interface"),
  351. pointer_default(unique)
  352. ]
  353. interface IAdvQueue : IUnknown
  354. {
  355. [helpstring("method SubmitMessage")] HRESULT SubmitMessage(
  356. [in] IMailMsgProperties *pIMailMsgProperties);
  357. [helpstring("method HandleFailedMessage")] HRESULT HandleFailedMessage(
  358. [in] IMailMsgProperties *pIMailMsgProperties,
  359. [in] BOOL fUseIMailMsgProperties,
  360. [in] LPSTR szFileName,
  361. [in] DWORD dwFailureDescription,
  362. [in] HRESULT hrFailureCode);
  363. };
  364. //---[ AQPerfCounters ]------------------------------------------------------------
  365. //
  366. //
  367. // Description: Struct containing A/Q perf counters
  368. //
  369. //
  370. //-----------------------------------------------------------------------------
  371. typedef struct _AQPerfCounters
  372. {
  373. DWORD cbVersion; //version / size of struct
  374. DWORD cMsgsDeliveredLocal;
  375. DWORD cCurrentMsgsPendingCat;
  376. DWORD cCurrentMsgsPendingRemoteDelivery;
  377. DWORD cCurrentMsgsPendingLocalDelivery;
  378. DWORD cCurrentMsgsPendingRemoteRetry;
  379. DWORD cCurrentMsgsPendingLocalRetry;
  380. DWORD cCurrentQueueMsgInstances;
  381. DWORD cTotalMsgRemoteSendRetries;
  382. DWORD cTotalMsgLocalRetries;
  383. DWORD cNDRsGenerated;
  384. DWORD cDelayedDSNsGenerated;
  385. DWORD cDeliveredDSNsGenerated;
  386. DWORD cRelayedDSNsGenerated;
  387. DWORD cExpandedDSNsGenerated;
  388. DWORD cCurrentRemoteDestQueues;
  389. DWORD cCurrentRemoteNextHopLinks;
  390. DWORD cCurrentRemoteNextHopLinksEnabled;
  391. DWORD cCurrentRemoteNextHopLinksPendingRetry;
  392. DWORD cCurrentRemoteNextHopLinksPendingScheduling;
  393. DWORD cCurrentRemoteNextHopLinksPendingTURNETRN;
  394. DWORD cCurrentRemoteNextHopLinksFrozenByAdmin;
  395. DWORD cTotalMsgsTURNETRN;
  396. DWORD cTotalMsgsBadmailNoRecipients;
  397. DWORD cTotalMsgsBadmailHopCountExceeded;
  398. DWORD cTotalMsgsBadmailFailureGeneral;
  399. DWORD cTotalMsgsBadmailBadPickupFile;
  400. DWORD cTotalMsgsBadmailEvent;
  401. DWORD cTotalMsgsBadmailNdrOfDsn;
  402. DWORD cCurrentMsgsPendingRouting;
  403. DWORD cCurrentMsgsPendingUnreachableLink;
  404. DWORD cTotalMsgsSubmitted;
  405. DWORD cTotalDSNFailures;
  406. DWORD cCurrentMsgsInLocalDelivery;
  407. } AQPerfCounters ;
  408. //---[ IAdvQueueConfig ]-------------------------------------------------------
  409. //
  410. //
  411. // Description: Configuration interface... used by SMTP to set global
  412. // and per-domain configuration info. GetDomainInfo will match the
  413. // closest configured wildcard domain if no exact match is found. For
  414. // example, dino.exchange.microsoft.com will match *.microsoft.com if
  415. // dino.exchange.microsoft.com and *.exchange.microsoft,com have no
  416. // specific config info.
  417. //
  418. //
  419. //-----------------------------------------------------------------------------
  420. [
  421. object,
  422. local,
  423. uuid(EABA472E-BE94-11d1-A678-00C04FA3490A),
  424. helpstring("IAdvQueueConfig Interface"),
  425. pointer_default(unique)
  426. ]
  427. interface IAdvQueueConfig : IUnknown
  428. {
  429. //set the global config info for this server instance
  430. [helpstring("method SetConfigInfo")] HRESULT SetConfigInfo(
  431. [in] AQConfigInfo *pAQConfigInfo);
  432. //set the domain configuration info for a specified domain
  433. [helpstring("method SetDomainInfo")] HRESULT SetDomainInfo(
  434. [in] DomainInfo *pDomainInfo);
  435. //get the domain config info... will handle wildcard matching
  436. [helpstring("method GetDomainInfo")] HRESULT GetDomainInfo(
  437. [in] DWORD cbDomainNameLength,
  438. [in, size_is(cbDomainNameLength+1)] CHAR szDomainName[],
  439. [in, out] DomainInfo *pDomainInfo,
  440. [out] DWORD **ppvDomainContext);
  441. //Releases references memory allocated in GetDomainInfo
  442. [helpstring("method ReleaseDomainInfo")] HRESULT ReleaseDomainInfo(
  443. [in] DWORD *pvDomainContext);
  444. //get A/Q perf counters
  445. [helpstring("method GetPerfCounters")] HRESULT GetPerfCounters(
  446. [out] AQPerfCounters *pAQPerfCounters,
  447. [out] PCATPERFBLOCK pCatPerfCounters);
  448. [helpstring("method ResetPerfCounters")] HRESULT ResetPerfCounters();
  449. //Used to start/finish an update
  450. [helpstring("method StartConfigUpdate")] HRESULT StartConfigUpdate();
  451. [helpstring("method FinishConfigUpdate")] HRESULT FinishConfigUpdate();
  452. };
  453. //---[ IAdvQueueDomainType ]---------------------------------------------------
  454. //
  455. //
  456. // Description:
  457. // Interface passed to the default categorizer that allows it to check if
  458. // a domain is local or not.
  459. // The methods are defined in ICategorizerDomainInfo/smtpevent.idl.
  460. //
  461. //-----------------------------------------------------------------------------
  462. [
  463. object,
  464. uuid(47EA42AD-2667-11d2-A68B-00C04FA3490A),
  465. helpstring("IAdvQueueDomainType Interface"),
  466. ]
  467. interface IAdvQueueDomainType : ICategorizerDomainInfo
  468. {
  469. }