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.

2216 lines
72 KiB

  1. //+------------------------------------------------------------
  2. //
  3. // Copyright (C) 1999, Microsoft Corporation
  4. //
  5. // File: smtpevent.idl
  6. //
  7. // Contents: SMTP Server Event interfaces
  8. //
  9. // Description: This file contains the interface definitions for the
  10. // SMTP Server Events.
  11. //
  12. //-------------------------------------------------------------
  13. cpp_quote("#ifndef __SMTPEVENT_H__")
  14. cpp_quote("#define __SMTPEVENT_H__")
  15. import "unknwn.idl";
  16. import "wtypes.idl";
  17. import "ocidl.idl";
  18. import "mailmsg.idl";
  19. //+------------------------------------------------------------
  20. //
  21. // The SMTP Protocol events interfaces:
  22. //
  23. //-------------------------------------------------------------
  24. cpp_quote("//")
  25. cpp_quote("// Define sink return codes")
  26. cpp_quote("//")
  27. cpp_quote("#define EXPE_S_CONSUMED 0x00000002")
  28. cpp_quote("//")
  29. cpp_quote("// Define well-known status codes")
  30. cpp_quote("//")
  31. cpp_quote("#define EXPE_SUCCESS 0x00000000")
  32. cpp_quote("#define EXPE_NOT_PIPELINED 0x00000000")
  33. cpp_quote("#define EXPE_PIPELINED 0x00000001")
  34. cpp_quote("#define EXPE_REPEAT_COMMAND 0x00000002")
  35. cpp_quote("#define EXPE_BLOB_READY 0x00000004")
  36. cpp_quote("#define EXPE_BLOB_DONE 0x00000008")
  37. cpp_quote("#define EXPE_DROP_SESSION 0x00010000")
  38. cpp_quote("#define EXPE_CHANGE_STATE 0x00020000")
  39. cpp_quote("#define EXPE_TRANSIENT_FAILURE 0x00040000")
  40. cpp_quote("#define EXPE_COMPLETE_FAILURE 0x00080000")
  41. cpp_quote("#define EXPE_UNHANDLED 0xffffffff")
  42. cpp_quote("//")
  43. cpp_quote("// Define constants for next states")
  44. cpp_quote("//")
  45. cpp_quote("typedef enum _PE_STATES")
  46. cpp_quote("{")
  47. cpp_quote(" PE_STATE_DEFAULT = 0,")
  48. cpp_quote(" PE_STATE_SESSION_START,")
  49. cpp_quote(" PE_STATE_MESSAGE_START,")
  50. cpp_quote(" PE_STATE_PER_RECIPIENT,")
  51. cpp_quote(" PE_STATE_DATA_OR_BDAT,")
  52. cpp_quote(" PE_STATE_SESSION_END,")
  53. cpp_quote(" PE_STATE_MAX_STATES = PE_STATE_SESSION_END")
  54. cpp_quote("")
  55. cpp_quote("} PE_STATES;")
  56. cpp_quote("//")
  57. cpp_quote("// Define macros for checking SMTP return code classes")
  58. cpp_quote("//")
  59. cpp_quote("#define IsSmtpPreliminarySuccess(x) ((((x) % 100) == 1)?TRUE:FALSE)")
  60. cpp_quote("#define IsSmtpCompleteSuccess(x) ((((x) % 100) == 2)?TRUE:FALSE)")
  61. cpp_quote("#define IsSmtpIntermediateSuccess(x) ((((x) % 100) == 3)?TRUE:FALSE)")
  62. cpp_quote("#define IsSmtpTransientFailure(x) ((((x) % 100) == 4)?TRUE:FALSE)")
  63. cpp_quote("#define IsSmtpCompleteFailure(x) ((((x) % 100) == 5)?TRUE:FALSE)")
  64. cpp_quote("//")
  65. cpp_quote("// Define well known IServer property IDs")
  66. cpp_quote("//")
  67. cpp_quote("#define PE_ISERVID_DW_INSTANCE 0")
  68. cpp_quote("#define PE_ISERVID_SZ_DEFAULTDOMAIN 1")
  69. cpp_quote("#define PE_ISERVID_DW_CATENABLE 2")
  70. cpp_quote("#define PE_ISERVID_DW_CATFLAGS 3")
  71. cpp_quote("#define PE_ISERVID_DW_CATPORT 4")
  72. cpp_quote("#define PE_ISERVID_SZ_CATUSER 5")
  73. cpp_quote("#define PE_ISERVID_SZ_CATSCHEMA 6")
  74. cpp_quote("#define PE_ISERVID_SZ_CATBINDTYPE 7")
  75. cpp_quote("#define PE_ISERVID_SZ_CATPASSWORD 8")
  76. cpp_quote("#define PE_ISERVID_SZ_CATDOMAIN 9")
  77. cpp_quote("#define PE_ISERVID_SZ_CATNAMINGCONTEXT 10")
  78. cpp_quote("#define PE_ISERVID_SZ_CATDSTYPE 11")
  79. cpp_quote("#define PE_ISERVID_SZ_CATDSHOST 12")
  80. cpp_quote("//")
  81. cpp_quote("// Define well known ISession property IDs")
  82. cpp_quote("//")
  83. cpp_quote("#define ISESSION_PID_IS_SESSION_AUTHENTICATED 0")
  84. cpp_quote("#define ISESSION_PID_AUTHENTICATED_USERNAME 1")
  85. cpp_quote("#define ISESSION_PID_REMOTE_SERVER_NAME 2")
  86. cpp_quote("#define ISESSION_PID_ANONYMOUS_AUTH 3")
  87. cpp_quote("#define ISESSION_PID_MAY_RELAY 4")
  88. cpp_quote("#define ISESSION_PID_LOCAL_IP_ADDRESS 5")
  89. cpp_quote("#define ISESSION_PID_REMOTE_IP_ADDRESS 6")
  90. cpp_quote("//")
  91. cpp_quote("// Define well known ISession for outbound property IDs")
  92. cpp_quote("//")
  93. cpp_quote("// Route Address as returned by GetNextHop")
  94. cpp_quote("#define ISESSION_PID_OUT_ROUTE_ADDRESS 100")
  95. cpp_quote("// Connector Name as returned by GetNextHop")
  96. cpp_quote("#define ISESSION_PID_OUT_CONNECTOR_NAME 101")
  97. cpp_quote("//")
  98. cpp_quote("// Categorizer Properties")
  99. cpp_quote("//")
  100. cpp_quote("#define PHAT_DSPARAMETER_ATTRIBUTE_DISPLAYNAME (DSPARAMETER_OBJECTCLASS_DL_DYNAMIC + 1)")
  101. cpp_quote("#define PHAT_DSPARAMETER_ENDENUMMESS (PHAT_DSPARAMETER_ATTRIBUTE_DISPLAYNAME + 1)")
  102. interface ISmtpInCallbackSink;
  103. [
  104. object,
  105. local,
  106. uuid(5F15C533-E90E-11D1-8852-00C04FA35B86),
  107. helpstring("ISmtpInCommandContext Interface"),
  108. pointer_default(unique)
  109. ]
  110. interface ISmtpInCommandContext : IUnknown
  111. {
  112. // Query methods
  113. HRESULT QueryCommand(
  114. [out,size_is(*pdwSize)] LPSTR pszCommand,
  115. [in,out] DWORD *pdwSize
  116. );
  117. HRESULT QueryCommandKeyword(
  118. [out,size_is(*pdwSize)] LPSTR pszKeyword,
  119. [in,out] DWORD *pdwSize
  120. );
  121. HRESULT QueryNativeResponse(
  122. [out,size_is(*pdwSize)] LPSTR pszNativeResponse,
  123. [in,out] DWORD *pdwSize
  124. );
  125. HRESULT QueryResponse(
  126. [out,size_is(*pdwSize)] LPSTR pszResponse,
  127. [in,out] DWORD *pdwSize
  128. );
  129. HRESULT QueryCommandSize(
  130. [out] DWORD *pdwSize
  131. );
  132. HRESULT QueryCommandKeywordSize(
  133. [out] DWORD *pdwSize
  134. );
  135. HRESULT QueryNativeResponseSize(
  136. [out] DWORD *pdwSize
  137. );
  138. HRESULT QueryResponseSize(
  139. [out] DWORD *pdwSize
  140. );
  141. HRESULT QueryCommandStatus(
  142. [out] DWORD *pdwCommandStatus
  143. );
  144. HRESULT QuerySmtpStatusCode(
  145. [out] DWORD *pdwSmtpStatus
  146. );
  147. HRESULT QueryProtocolErrorFlag(
  148. [out] BOOL *pfProtocolError
  149. );
  150. // Set methods
  151. HRESULT SetResponse(
  152. [in,string] LPSTR pszResponse,
  153. [in] DWORD dwSize
  154. );
  155. HRESULT AppendResponse(
  156. [in,string] LPSTR pszResponse,
  157. [in] DWORD dwSize
  158. );
  159. HRESULT SetNativeResponse(
  160. [in,string] LPSTR pszNativeResponse,
  161. [in] DWORD dwSize
  162. );
  163. HRESULT AppendNativeResponse(
  164. [in,string] LPSTR pszNativeResponse,
  165. [in] DWORD dwSize
  166. );
  167. HRESULT SetCommandStatus(
  168. [in] DWORD dwCommandStatus
  169. );
  170. HRESULT SetSmtpStatusCode(
  171. [in] DWORD dwSmtpStatus
  172. );
  173. HRESULT SetProtocolErrorFlag(
  174. [in] BOOL fProtocolError
  175. );
  176. // Async completion callback
  177. HRESULT NotifyAsyncCompletion(
  178. [in] HRESULT hrResult
  179. );
  180. HRESULT SetCallback(
  181. [in] ISmtpInCallbackSink * pICallback
  182. );
  183. };
  184. [
  185. object,
  186. local,
  187. uuid(5e4fc9da-3e3b-11d3-88f1-00c04fa35b86),
  188. helpstring("ISmtpInCallbackContext Interface"),
  189. pointer_default(unique)
  190. ]
  191. interface ISmtpInCallbackContext : IUnknown
  192. {
  193. // Query methods
  194. HRESULT QueryBlob(
  195. [out] BYTE **ppbBlob,
  196. [in,out] DWORD *pdwSize
  197. );
  198. HRESULT QueryBlobSize(
  199. [out] DWORD *pdwSize
  200. );
  201. // Set methods
  202. HRESULT SetResponse(
  203. [in,string] LPSTR pszResponse,
  204. [in] DWORD dwSize
  205. );
  206. HRESULT AppendResponse(
  207. [in,string] LPSTR pszResponse,
  208. [in] DWORD dwSize
  209. );
  210. HRESULT SetCommandStatus(
  211. [in] DWORD dwCommandStatus
  212. );
  213. HRESULT SetSmtpStatusCode(
  214. [in] DWORD dwSmtpStatus
  215. );
  216. };
  217. [
  218. object,
  219. local,
  220. uuid(c849b5f2-0a80-11d2-aa67-00c04fa35b82),
  221. helpstring("ISmtpOutCommandContext Interface"),
  222. pointer_default(unique)
  223. ]
  224. interface ISmtpOutCommandContext : IUnknown
  225. {
  226. // Query methods
  227. HRESULT QueryCommand(
  228. [out,size_is(*pdwSize)] LPSTR pszCommand,
  229. [in,out] DWORD *pdwSize
  230. );
  231. HRESULT QueryCommandKeyword(
  232. [out,size_is(*pdwSize)] LPSTR pszKeyword,
  233. [in,out] DWORD *pdwSize
  234. );
  235. HRESULT QueryNativeCommand(
  236. [out,size_is(*pdwSize)] LPSTR pszNativeCommand,
  237. [in,out] DWORD *pdwSize
  238. );
  239. HRESULT QueryCommandSize(
  240. [out] DWORD *pdwSize
  241. );
  242. HRESULT QueryCommandKeywordSize(
  243. [out] DWORD *pdwSize
  244. );
  245. HRESULT QueryNativeCommandSize(
  246. [out] DWORD *pdwSize
  247. );
  248. HRESULT QueryCurrentRecipientIndex(
  249. [out] DWORD *pdwRecipientIndex
  250. );
  251. HRESULT QueryCommandStatus(
  252. [out] DWORD *pdwCommandStatus
  253. );
  254. // Set methods
  255. HRESULT SetCommand(
  256. [in,string] LPSTR szCommand,
  257. [in] DWORD dwSize
  258. );
  259. HRESULT AppendCommand(
  260. [in,string] LPSTR szCommand,
  261. [in] DWORD dwSize
  262. );
  263. HRESULT SetCommandStatus(
  264. [in] DWORD dwCommandStatus
  265. );
  266. // Async completion callback
  267. HRESULT NotifyAsyncCompletion(
  268. [in] HRESULT hrResult
  269. );
  270. HRESULT SetBlob(
  271. [in] BYTE *pbBlob,
  272. [in] DWORD dwSize
  273. );
  274. };
  275. [
  276. object,
  277. local,
  278. uuid(e38f9ad2-0a82-11d2-aa67-00c04fa35b82),
  279. helpstring("ISmtpServerResponseContext Interface"),
  280. pointer_default(unique)
  281. ]
  282. interface ISmtpServerResponseContext : IUnknown
  283. {
  284. // Query methods
  285. HRESULT QueryCommand(
  286. [out,size_is(*pdwSize)] LPSTR pszCommand,
  287. [in,out] DWORD *pdwSize
  288. );
  289. HRESULT QueryCommandKeyword(
  290. [out,size_is(*pdwSize)] LPSTR pszKeyword,
  291. [in,out] DWORD *pdwSize
  292. );
  293. HRESULT QueryResponse(
  294. [out,size_is(*pdwSize)] LPSTR pszResponse,
  295. [in,out] DWORD *pdwSize
  296. );
  297. HRESULT QueryCommandSize(
  298. [out] DWORD *pdwSize
  299. );
  300. HRESULT QueryCommandKeywordSize(
  301. [out] DWORD *pdwSize
  302. );
  303. HRESULT QueryResponseSize(
  304. [out] DWORD *pdwSize
  305. );
  306. HRESULT QuerySmtpStatusCode(
  307. [out] DWORD *pdwSmtpStatus
  308. );
  309. HRESULT QueryResponseStatus(
  310. [out] DWORD *pdwResponseStatus
  311. );
  312. HRESULT QueryPipelinedFlag(
  313. [out] BOOL *pfResponseIsPipelined
  314. );
  315. HRESULT QueryNextEventState(
  316. [out] DWORD *pdwNextState
  317. );
  318. // Set methods
  319. HRESULT SetResponseStatus(
  320. [in] DWORD dwResponseStatus
  321. );
  322. HRESULT SetNextEventState(
  323. [in] DWORD dwNextState
  324. );
  325. // Async completion callback
  326. HRESULT NotifyAsyncCompletion(
  327. [in] HRESULT hrResult
  328. );
  329. };
  330. // =============================================================
  331. //
  332. // Inbound Protocol Event Sink Shape
  333. //
  334. [
  335. object,
  336. uuid(b2d42a0e-0d5f-11d2-aa68-00c04fa35b82),
  337. helpstring("ISmtpInCommandSink Interface"),
  338. pointer_default(unique)
  339. ]
  340. interface ISmtpInCommandSink : IUnknown
  341. {
  342. [helpstring("OnSmtpInCommand method")]
  343. HRESULT OnSmtpInCommand(
  344. [in] IUnknown *pServer,
  345. [in] IUnknown *pSession,
  346. [in] IMailMsgProperties *pMsg,
  347. [in] ISmtpInCommandContext *pContext
  348. );
  349. };
  350. // =============================================================
  351. //
  352. // Outbound Command Generation Protocol Event Sink Shape
  353. //
  354. [
  355. object,
  356. uuid(cfdbb9b0-0ca0-11d2-aa68-00c04fa35b82),
  357. helpstring("ISmtpOutCommandSink Interface"),
  358. pointer_default(unique)
  359. ]
  360. interface ISmtpOutCommandSink : IUnknown
  361. {
  362. [helpstring("OnSmtpOutCommand method")]
  363. HRESULT OnSmtpOutCommand(
  364. [in] IUnknown *pServer,
  365. [in] IUnknown *pSession,
  366. [in] IMailMsgProperties *pMsg,
  367. [in] ISmtpOutCommandContext *pContext
  368. );
  369. };
  370. // =============================================================
  371. //
  372. // Server Response Protocol Event Sink Shape
  373. //
  374. [
  375. object,
  376. uuid(d7e10222-0ca1-11d2-aa68-00c04fa35b82),
  377. helpstring("ISmtpServerResponseSink Interface"),
  378. pointer_default(unique)
  379. ]
  380. interface ISmtpServerResponseSink : IUnknown
  381. {
  382. [helpstring("OnSmtpServerResponse method")]
  383. HRESULT OnSmtpServerResponse(
  384. [in] IUnknown *pServer,
  385. [in] IUnknown *pSession,
  386. [in] IMailMsgProperties *pMsg,
  387. [in] ISmtpServerResponseContext *pContext
  388. );
  389. };
  390. // =============================================================
  391. //
  392. // Inbound Protocol Event Callback Sink Shape
  393. //
  394. [
  395. object,
  396. uuid(0012b624-3e3c-11d3-88f1-00c04fa35b86),
  397. helpstring("ISmtpInCallbackSink Interface"),
  398. pointer_default(unique)
  399. ]
  400. interface ISmtpInCallbackSink : IUnknown
  401. {
  402. [helpstring("OnSmtpInCallback method")]
  403. HRESULT OnSmtpInCallback(
  404. [in] IUnknown *pServer,
  405. [in] IUnknown *pSession,
  406. [in] IMailMsgProperties *pMsg,
  407. [in] ISmtpInCallbackContext *pContext
  408. );
  409. };
  410. //+------------------------------------------------------------
  411. //
  412. // The SMTP Mail Transport interfaces:
  413. //
  414. //-------------------------------------------------------------
  415. //
  416. // The default processing priority of the transport events:
  417. //
  418. cpp_quote("#define SMTP_TRANSPORT_DEFAULT_PRIORITY 16384")
  419. //+------------------------------------------------------------
  420. //
  421. // Interface: IMailTransportNotify
  422. //
  423. // Synopsis: Used for async events
  424. //
  425. //
  426. //-------------------------------------------------------------
  427. [
  428. object,
  429. uuid(6E1CAA77-FCD4-11d1-9DF9-00C04FA322BA),
  430. helpstring("IMailTransportNotify Interface"),
  431. pointer_default(unique)
  432. ]
  433. interface IMailTransportNotify : IUnknown
  434. {
  435. [local]
  436. HRESULT Notify(
  437. [in] HRESULT hrCompletion,
  438. [in] PVOID pvContext);
  439. };
  440. //+------------------------------------------------------------
  441. //
  442. // Interface: IMailTransportSubmission
  443. //
  444. // Synopsis: Used for the SMTP_MAILTRANSPORT_ONMESSAGESUBMISSION event
  445. //
  446. //
  447. //-------------------------------------------------------------
  448. [
  449. object,
  450. uuid(CE681916-FF14-11d1-9DFB-00C04FA322BA),
  451. helpstring("IMailTransportSubmission Interface"),
  452. pointer_default(unique)
  453. ]
  454. interface IMailTransportSubmission : IUnknown
  455. {
  456. [local]
  457. HRESULT OnMessageSubmission(
  458. [in] IMailMsgProperties *pIMailMsg,
  459. [in] IMailTransportNotify *pINotify,
  460. [in] PVOID pvNotifyContext);
  461. };
  462. //+------------------------------------------------------------
  463. //
  464. // Interface: IMailTransportOnPreCategorize
  465. //
  466. // Synopsis: Used for the SMTP_MAILTRANSPORT_PRECATEGORIZE event
  467. //
  468. //
  469. //-------------------------------------------------------------
  470. [
  471. object,
  472. uuid(A3ACFB0E-83FF-11d2-9E14-00C04FA322BA),
  473. helpstring("IMailTransportOnPreCategorize Interface"),
  474. pointer_default(unique)
  475. ]
  476. interface IMailTransportOnPreCategorize : IUnknown
  477. {
  478. [local]
  479. HRESULT OnSyncMessagePreCategorize(
  480. [in] IMailMsgProperties *pIMailMsg,
  481. [in] IMailTransportNotify *pINotify,
  482. [in] PVOID pvNotifyContext);
  483. };
  484. //+------------------------------------------------------------
  485. //
  486. // Interface: IMailTransportOnPostCategorize
  487. //
  488. // Synopsis: Used for the SMTP_MAILTRANSPORT_POSTCATEGORIZE event
  489. //
  490. //
  491. //-------------------------------------------------------------
  492. [
  493. object,
  494. uuid(76719653-05A6-11d2-9DFD-00C04FA322BA),
  495. helpstring("IMailTransportOnPostCategorize Interface"),
  496. pointer_default(unique)
  497. ]
  498. interface IMailTransportOnPostCategorize : IUnknown
  499. {
  500. [local]
  501. HRESULT OnMessagePostCategorize(
  502. [in] IMailMsgProperties *pIMailMsg,
  503. [in] IMailTransportNotify *pINotify,
  504. [in] PVOID pvNotifyContext);
  505. };
  506. cpp_quote("#define RESET_NEXT_HOPS 0")
  507. cpp_quote("#define RESET_MESSAGE_TYPES 1")
  508. //+------------------------------------------------------------
  509. //
  510. // Interface: IMailTransportRouterReset
  511. //
  512. // Synopsis: System implemented interface for resetting routes
  513. //
  514. //
  515. //-------------------------------------------------------------
  516. [
  517. object,
  518. uuid(A928AD12-1610-11d2-9E02-00C04FA322BA),
  519. helpstring("IMailTransportRouterReset Interface"),
  520. pointer_default(unique)
  521. ]
  522. interface IMailTransportRouterReset : IUnknown
  523. {
  524. HRESULT ResetRoutes(
  525. [in] DWORD dwResetType);
  526. };
  527. //+------------------------------------------------------------
  528. //
  529. // Interface: IMailTransportSetRouterReset
  530. //
  531. // Synopsis: Used for the SMTP_MAILTRANSPORT_ON_SET_ROUTER_RESET event
  532. //
  533. //
  534. //-------------------------------------------------------------
  535. [
  536. object,
  537. uuid(A928AD11-1610-11d2-9E02-00C04FA322BA),
  538. helpstring("IMailTransportSetRouterReset Interface"),
  539. pointer_default(unique)
  540. ]
  541. interface IMailTransportSetRouterReset : IUnknown
  542. {
  543. HRESULT RegisterResetInterface(
  544. [in] DWORD dwVirtualServerID,
  545. [in] IMailTransportRouterReset *pIRouterReset);
  546. };
  547. //+------------------------------------------------------------
  548. //
  549. // Interface: IMessageRouter
  550. //
  551. // Synopsis: Sink supplied interface
  552. //
  553. //
  554. //-------------------------------------------------------------
  555. [
  556. object,
  557. uuid(A928AD14-1610-11d2-9E02-00C04FA322BA),
  558. helpstring("IMessageRouter Interface"),
  559. pointer_default(unique)
  560. ]
  561. interface IMessageRouter : IUnknown
  562. {
  563. [local]
  564. GUID GetTransportSinkID();
  565. HRESULT GetMessageType(
  566. [in] IMailMsgProperties *pIMailMsg,
  567. [out] DWORD *pdwMessageType);
  568. HRESULT ReleaseMessageType(
  569. [in] DWORD dwMessageType,
  570. [in] DWORD dwReleaseCount);
  571. [local]
  572. HRESULT GetNextHop(
  573. [in] LPSTR pszDestinationAddressType,
  574. [in] LPSTR pszDestinationAddress,
  575. [in] DWORD dwMessageType,
  576. [out] LPSTR *ppszRouteAddressType,
  577. [out] LPSTR *ppszRouteAddress,
  578. [out] DWORD *pdwScheduleID,
  579. [out] LPSTR *ppszRouteAddressClass,
  580. [out] LPSTR *ppszConnectorName,
  581. [out] DWORD *pdwNextHopType);
  582. [local]
  583. HRESULT GetNextHopFree(
  584. [in] LPSTR pszDestinationAddressType,
  585. [in] LPSTR pszDestinationAddress,
  586. [in] LPSTR pszConnectorName,
  587. [in] LPSTR pszRouteAddressType,
  588. [in] LPSTR pszRouteAddress,
  589. [in] LPSTR pszRouteAddressClass);
  590. HRESULT ConnectionFailed(
  591. [in, string] LPSTR pszConnectorName);
  592. };
  593. //Some standard RouteAddressTypes that might be returned by GetNextHop
  594. const LPCSTR MTI_ROUTING_ADDRESS_TYPE_NULL = NULL;
  595. const LPCSTR MTI_ROUTING_ADDRESS_TYPE_SMTP = "SMTP";
  596. const LPCSTR MTI_ROUTING_ADDRESS_TYPE_X400 = "X400";
  597. const LPCSTR MTI_ROUTING_ADDRESS_TYPE_X500 = "X500";
  598. //---[ NEXT_HOP_TYPE ]---------------------------------------------------------
  599. //
  600. //
  601. // Description:
  602. // Enum for the possible next hop types
  603. //
  604. //-----------------------------------------------------------------------------
  605. typedef [v1_enum] enum {
  606. MTI_NEXT_HOP_TYPE_SAME_VIRTUAL_SERVER,
  607. MTI_NEXT_HOP_TYPE_PEER_SMTP1_BYPASS_CONFIG_LOOKUP,
  608. MTI_NEXT_HOP_TYPE_EXTERNAL_SMTP,
  609. MTI_NEXT_HOP_TYPE_UNREACHABLE,
  610. MTI_NEXT_HOP_TYPE_CURRENTLY_UNREACHABLE,
  611. MTI_NEXT_HOP_TYPE_PEER_SMTP2_BYPASS_CONFIG_LOOKUP
  612. } MTI_NEXT_HOP_TYPE, *PMTI_NEXT_HOP_TYPE;
  613. // #defines for old names for these values
  614. #define MTI_NEXT_HOP_TYPE_REMOTE \
  615. (MTI_NEXT_HOP_TYPE_PEER_SMTP1_BYPASS_CONFIG_LOOKUP)
  616. #define MTI_NEXT_HOP_TYPE_RESERVED \
  617. (MTI_NEXT_HOP_TYPE_EXTERNAL_SMTP)
  618. //+------------------------------------------------------------
  619. //
  620. // Interface: IMailTransportRouterSetLinkState
  621. //
  622. // Synopsis: System implemented interface for allowing a
  623. // routing sink to update the link state for features such
  624. // as:
  625. // - Scheduled Connections
  626. // - Scheduled Commands
  627. //
  628. // If LINK_STATE_SCHED_ENABLED is being unset... a next
  629. // scheduled connection time should be returned.
  630. //
  631. //
  632. //-------------------------------------------------------------
  633. [
  634. object,
  635. uuid(B870CE28-A755-11d2-A6A9-00C04FA3490A),
  636. helpstring("IMailTransportRouterSetLinkState Interface"),
  637. pointer_default(unique)
  638. ]
  639. interface IMailTransportRouterSetLinkState : IUnknown
  640. {
  641. HRESULT SetLinkState(
  642. [in] LPSTR szLinkDomainName,
  643. [in] GUID guidRouterGUID,
  644. [in] DWORD dwScheduleID,
  645. [in] LPSTR szConnectorName,
  646. [in] DWORD dwSetLinkState,
  647. [in] DWORD dwUnsetLinkState,
  648. [in] FILETIME *pftNextScheduled,
  649. [in] IMessageRouter *pMessageRouter);
  650. };
  651. //+------------------------------------------------------------
  652. //
  653. // Interface: IMessageRouterLinkStateNotification
  654. //
  655. // Synopsis: Sink supplied interface that is used for notifying
  656. // the routing sink of link state on connection acks.
  657. //
  658. // If LINK_STATE_SCHED_ENABLED is being unset... a next
  659. // scheduled connection time should be returned.
  660. //
  661. //
  662. //-------------------------------------------------------------
  663. [
  664. object,
  665. uuid(B870CE29-A755-11d2-A6A9-00C04FA3490A),
  666. helpstring("IMessageRouterLinkStateNotification Interface"),
  667. pointer_default(unique)
  668. ]
  669. interface IMessageRouterLinkStateNotification : IUnknown
  670. {
  671. HRESULT LinkStateNotify(
  672. [in] LPSTR szLinkDomainName,
  673. [in] GUID guidRouterGUID,
  674. [in] DWORD dwScheduleID,
  675. [in] LPSTR szConnectorName,
  676. [in] DWORD dwLinkState,
  677. [in] DWORD cConsecutiveFailures,
  678. [in, out] FILETIME *pftNextScheduled,
  679. [out] DWORD *pdwSetLinkState,
  680. [out] DWORD *pdwUnsetLinkState);
  681. };
  682. //---[ eLinkInfoFlags ]--------------------------------------------------------
  683. //
  684. //
  685. // Description: Flags used to describe boolean per *link* state. Used to
  686. // decide if it is an appropriate time to make a connection. Event sinks
  687. // can set and unset these flags to influence the connection manager.
  688. //
  689. //-----------------------------------------------------------------------------
  690. typedef [v1_enum] enum
  691. {
  692. LINK_STATE_NO_ACTION = 0x00000000, //NULL op... setting/unsetting this has no effect on link state
  693. LINK_STATE_RETRY_ENABLED = 0x00000001, //If NOT set, link is pending retry
  694. LINK_STATE_SCHED_ENABLED = 0x00000002, //If NOT set, link is pending scheduled connection
  695. LINK_STATE_CMD_ENABLED = 0x00000004, //If set, link should be activated to send a command
  696. LINK_STATE_ADMIN_HALT = 0x00000008, //If set, admin has request no connections be made
  697. LINK_STATE_ADMIN_FORCE_CONN = 0x00000010, //Admin has requested that a connection be made now
  698. LINK_STATE_CONNECT_IF_NO_MSGS = 0x00000020, //Connect even if there are no messages. Link will not be deleted while this is set.
  699. LINK_STATE_DO_NOT_DELETE = 0x00000040, //Routing is interested in this link... it should not be deleted by the transport.
  700. LINK_STATE_CREATE_IF_NECESSARY = 0x00000080, //Create a new link if one doesn't exist
  701. LINK_STATE_LINK_NO_LONGER_USED = 0x00000100, //Set when SMTP is done with link
  702. LINK_STATE_TYPE_INTERNAL_SMTP = 0x00000200,
  703. LINK_STATE_TYPE_EXTERNAL_SMTP = 0x00000400,
  704. LINK_STATE_DO_NOT_DELETE_UNTIL_NEXT_NOTIFY = 0x00000800,
  705. LINK_STATE_RETRY_ALL_DNS_FAILURES = 0x00001000,
  706. LINK_STATE_RESERVED = 0xFFFF0000, //Reserved for internal use
  707. } eLinkStateFlags;
  708. //+------------------------------------------------------------
  709. //
  710. // Interface: IMailTransportRoutingEngine
  711. //
  712. // Synopsis: Used for the SMTP_MAILTRANSPORT_ON_GET_ROUTER_FOR_MESSAGE event
  713. //
  714. //
  715. //-------------------------------------------------------------
  716. //
  717. // Specific error code(s) that can be returned from GetMessageRouter
  718. //
  719. cpp_quote("#define ROUTER_E_NOTINTERESTED MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,0x1000)")
  720. [
  721. object,
  722. uuid(A928AD13-1610-11d2-9E02-00C04FA322BA),
  723. helpstring("IMailTransportRoutingEngine Interface"),
  724. pointer_default(unique)
  725. ]
  726. interface IMailTransportRoutingEngine : IUnknown
  727. {
  728. [local]
  729. HRESULT GetMessageRouter(
  730. [in] IMailMsgProperties *pIMailMsg,
  731. [in] IMessageRouter *pICurrentMessageRouter,
  732. [out] IMessageRouter **ppIMessageRouter);
  733. };
  734. cpp_quote("#define MTE_QUEUED_OUTBOUND 1010")
  735. cpp_quote("#define MTE_TRANSFERRED_OUTBOUND 1011")
  736. cpp_quote("#define MTE_RECEIVED_INBOUND 1012")
  737. cpp_quote("#define MTE_TRANSFERRED_INBOUND 1013")
  738. cpp_quote("#define MTE_MESSAGE_REROUTED 1014")
  739. cpp_quote("#define MTE_REPORT_TRANSFERRED_IN 1015")
  740. cpp_quote("#define MTE_REPORT_TRANSFERRED_OUT 1016")
  741. cpp_quote("#define MTE_REPORT_GENERATED 1017")
  742. cpp_quote("#define MTE_REPORT_ABSORBED 1018")
  743. cpp_quote("#define MTE_SUBMIT_MESSAGE_TO_AQ 1019")
  744. cpp_quote("#define MTE_BEGIN_OUTBOUND_TRANSFER 1020")
  745. cpp_quote("#define MTE_BADMAIL 1021")
  746. cpp_quote("#define MTE_AQ_FAILURE 1022")
  747. cpp_quote("#define MTE_LOCAL_DELIVERY 1023")
  748. cpp_quote("#define MTE_SUBMIT_MESSAGE_TO_CAT 1024")
  749. cpp_quote("#define MTE_BEGIN_SUBMIT_MESSAGE 1025")
  750. cpp_quote("#define MTE_AQ_FAILED_MESSAGE 1026")
  751. cpp_quote("#define MTE_NDR_ALL 1030")
  752. cpp_quote("#define MTE_END_OUTBOUND_TRANSFER 1031")
  753. [
  754. helpstring("Interface For Message Tracking."),
  755. local,
  756. object,
  757. pointer_default(unique),
  758. uuid(1bc3580e-7e4f-11d2-94f4-00C04f79f1d6)
  759. ]
  760. interface IMsgTrackLog : IUnknown
  761. {
  762. HRESULT OnSyncLogMsgTrackInfo(
  763. [in] IUnknown *pIServer,
  764. [in] IMailMsgProperties *pIMailMsgProp,
  765. [in] LPMSG_TRACK_INFO pMsgTrackInfo);
  766. };
  767. [
  768. helpstring("Interface For Enumerating Resolver Records."),
  769. local,
  770. object,
  771. pointer_default(unique),
  772. uuid(e5b89c52-8e0b-11d2-94f6-00C04f79f1d6)
  773. ]
  774. interface IDnsResolverRecord : IUnknown
  775. {
  776. HRESULT GetItem( [in] ULONG cIndex, [out] LPSTR *ppszHostName, [out] DWORD *pAddr );
  777. HRESULT Count( [out] DWORD *pcRecords );
  778. };
  779. typedef struct tagDNS_SERVER_INFO
  780. {
  781. GUID guidNetwork;
  782. PVOID pipServers;
  783. }
  784. DNS_SERVER_INFO, *PDNS_SERVER_INFO;
  785. [
  786. helpstring("Interface For returning status from DNS resolver sink."),
  787. local,
  788. object,
  789. pointer_default(unique),
  790. uuid(6A417A4C-27BA-4867-A286-83E332074558)
  791. ]
  792. interface IDnsInfoSink : IUnknown
  793. {
  794. HRESULT OnSyncGetDnsInfo([in] LPSTR pszHostName,
  795. [in] LPSTR pszInstanceFQDN,
  796. [in] DWORD dwVirtualServerId,
  797. [out] DNS_SERVER_INFO **ppDnsServerInfo,
  798. [out] IDnsResolverRecord **ppDnsResolverRecord);
  799. };
  800. [
  801. helpstring("Interface For Getting Resolver Records and DnsServerInfo."),
  802. local,
  803. object,
  804. pointer_default(unique),
  805. uuid(4e60bfad-a179-47AC-8961-c7c1f0785ac1)
  806. ]
  807. interface IDnsStatus : IUnknown
  808. {
  809. HRESULT GetDnsStatus();
  810. };
  811. [
  812. helpstring("Interface For Getting Resolver Records."),
  813. local,
  814. object,
  815. pointer_default(unique),
  816. uuid(d95a4d0c-8e06-11d2-94f6-00C04f79f1d6)
  817. ]
  818. interface IDnsResolverRecordSink : IUnknown
  819. {
  820. HRESULT OnSyncGetResolverRecord( [in] LPSTR pszHostName,
  821. [in] LPSTR pszInstanceFQDN,
  822. [in] DWORD dwVirtualServerId,
  823. [out] IDnsResolverRecord **ppDnsResolverRecord);
  824. };
  825. [
  826. helpstring("MaxMsgSize Exceeded event interface."),
  827. local,
  828. object,
  829. pointer_default(unique),
  830. uuid(b997f192-a67d-11d2-94f7-00C04f79f1d6)
  831. ]
  832. interface ISmtpMaxMsgSize : IUnknown
  833. {
  834. HRESULT OnSyncMaxMsgSize( [in] IUnknown *pIUnknown,
  835. [in] IMailMsgProperties *pIMailMsgProp,
  836. [out] BOOL *pfShouldImposeLimit );
  837. };
  838. [
  839. helpstring("Log event interface."),
  840. local,
  841. object,
  842. pointer_default(unique),
  843. uuid(35bc9ad7-7aa5-43ee-a0ab-94e1d6be99e5)
  844. ]
  845. interface ISmtpLog : IUnknown
  846. {
  847. HRESULT OnSyncLog(
  848. [in] LPSMTP_LOG_EVENT_INFO pLogEventInfo);
  849. };
  850. [
  851. helpstring("Get Aux Domain Info Flags event interface."),
  852. local,
  853. object,
  854. pointer_default(unique),
  855. uuid(d038c9da-4977-491d-8b0e-97f2e546c35a)
  856. ]
  857. interface ISmtpGetAuxDomainInfoFlags : IUnknown
  858. {
  859. HRESULT OnGetAuxDomainInfoFlags(
  860. [in] IUnknown *pIServer,
  861. [in] LPCSTR pszDomainName,
  862. [out] DWORD *pdwDomainInfoFlags );
  863. };
  864. //+------------------------------------------------------------
  865. //
  866. // The Categorizer event interfaces:
  867. //
  868. //-------------------------------------------------------------
  869. interface ICategorizerListResolve;
  870. interface ICategorizerItemAttributes;
  871. interface ICategorizerMailMsgs;
  872. interface ICategorizerItem;
  873. interface ICategorizerDomainInfo;
  874. interface ISMTPCategorizer;
  875. interface ISMTPCategorizerCompletion;
  876. interface ISMTPCategorizerDLCompletion;
  877. //
  878. // A structure and definitions to handle the configuration of
  879. // a virtual server (for categorizer)
  880. //
  881. typedef [v1_enum] enum
  882. {
  883. CCAT_CONFIG_INFO_FLAGS = 0x0001,
  884. CCAT_CONFIG_INFO_ROUTINGTYPE = 0x0002,
  885. CCAT_CONFIG_INFO_BINDDOMAIN = 0x0004,
  886. CCAT_CONFIG_INFO_USER = 0x0008,
  887. CCAT_CONFIG_INFO_PASSWORD = 0x0010,
  888. CCAT_CONFIG_INFO_BINDTYPE = 0x0020,
  889. CCAT_CONFIG_INFO_SCHEMATYPE = 0x0040,
  890. CCAT_CONFIG_INFO_HOST = 0x0080,
  891. CCAT_CONFIG_INFO_NAMINGCONTEXT = 0x0100,
  892. CCAT_CONFIG_INFO_DEFAULTDOMAIN = 0x0200,
  893. CCAT_CONFIG_INFO_PORT = 0x0400,
  894. CCAT_CONFIG_INFO_ISMTPSERVER = 0x0800,
  895. CCAT_CONFIG_INFO_IDOMAININFO = 0x1000,
  896. CCAT_CONFIG_INFO_ENABLE = 0x2000,
  897. CCAT_CONFIG_INFO_DEFAULT = 0x4000,
  898. CCAT_CONFIG_INFO_VSID = 0x8000,
  899. CCAT_CONFIG_INFO_ALL = 0xFFFF
  900. } eCatConfigInfoFlags;
  901. typedef struct _tagCCatConfigInfo {
  902. DWORD dwCCatConfigInfoFlags; //Flags describing which fields
  903. //are valid
  904. DWORD dwEnable;
  905. DWORD dwCatFlags;
  906. LPSTR pszRoutingType;
  907. LPSTR pszBindDomain;
  908. LPSTR pszUser;
  909. LPSTR pszPassword;
  910. LPSTR pszBindType;
  911. LPSTR pszSchemaType;
  912. LPSTR pszHost;
  913. LPSTR pszNamingContext;
  914. LPSTR pszDefaultDomain;
  915. DWORD dwPort;
  916. ISMTPServer *pISMTPServer;
  917. ICategorizerDomainInfo *pIDomainInfo;
  918. DWORD dwVirtualServerID;
  919. } CCATCONFIGINFO, *PCCATCONFIGINFO;
  920. typedef [v1_enum] enum _CAT_ADDRESS_TYPE {
  921. CAT_SMTP = 0, // SMTP address type
  922. CAT_X500 = 1, // X500 address type (ex: "/DC=blah/dc=...")
  923. CAT_X400 = 2, // X400 address type
  924. CAT_DN = 3, // Distinguished Name
  925. CAT_LEGACYEXDN = 4, // LegacyExchangeDN attribute
  926. CAT_CUSTOMTYPE = 5, // Foreign address type
  927. CAT_UNKNOWNTYPE = 6, // Not a valid input value
  928. } CAT_ADDRESS_TYPE;
  929. //+------------------------------------------------------------
  930. //
  931. // Interface: ICategorizerProperties
  932. //
  933. // Synopsis: Property setting/retrieval interface
  934. //
  935. //
  936. //-------------------------------------------------------------
  937. [
  938. local,
  939. object,
  940. uuid(96BF3199-79D8-11d2-9E11-00C04FA322BA),
  941. helpstring("ICategorizerProperties Interface"),
  942. pointer_default(unique)
  943. ]
  944. interface ICategorizerProperties : IUnknown
  945. {
  946. HRESULT GetStringA(
  947. [in] DWORD dwPropId,
  948. [in] DWORD dwcchValue,
  949. [out, size_is(dwcchValue)] LPSTR pszValue);
  950. HRESULT PutStringA(
  951. [in] DWORD dwPropId,
  952. [in, unique] LPSTR pszValue);
  953. HRESULT GetDWORD(
  954. [in] DWORD dwPropId,
  955. [out] DWORD *pdwValue);
  956. HRESULT PutDWORD(
  957. [in] DWORD dwPropId,
  958. [in] DWORD dwValue);
  959. HRESULT GetHRESULT(
  960. [in] DWORD dwPropId,
  961. [out] HRESULT *phrValue);
  962. HRESULT PutHRESULT(
  963. [in] DWORD dwPropId,
  964. [in] HRESULT hrValue);
  965. HRESULT GetBool(
  966. [in] DWORD dwPropId,
  967. [out] BOOL *pfValue);
  968. HRESULT PutBool(
  969. [in] DWORD dwPropId,
  970. [in] BOOL fValue);
  971. HRESULT GetPVoid(
  972. [in] DWORD dwPropId,
  973. [out] PVOID *pvValue);
  974. HRESULT PutPVoid(
  975. [in] DWORD dwPropId,
  976. [in] PVOID pvValue);
  977. HRESULT GetIUnknown(
  978. [in] DWORD dwPropId,
  979. [out] IUnknown **pUnknown);
  980. HRESULT PutIUnknown(
  981. [in] DWORD dwPropId,
  982. [in] IUnknown *pUnknown);
  983. HRESULT GetIMailMsgProperties(
  984. [in] DWORD dwPropId,
  985. [out] IMailMsgProperties **ppIMsg);
  986. HRESULT PutIMailMsgProperties(
  987. [in] DWORD dwPropId,
  988. [in] IMailMsgProperties *pIMsg);
  989. HRESULT GetIMailMsgRecipientsAdd(
  990. [in] DWORD dwPropId,
  991. [out] IMailMsgRecipientsAdd **ppIMsgRecipientsAdd);
  992. HRESULT PutIMailMsgRecipientsAdd(
  993. [in] DWORD dwPropId,
  994. [in] IMailMsgRecipientsAdd *pIMsgRecipientsAdd);
  995. HRESULT GetICategorizerItemAttributes(
  996. [in] DWORD dwPropId,
  997. [out] ICategorizerItemAttributes **ppICategorizerItemAttributes);
  998. HRESULT PutICategorizerItemAttributes(
  999. [in] DWORD dwPropId,
  1000. [in] ICategorizerItemAttributes *pICategorizerItemAttributes);
  1001. HRESULT GetICategorizerListResolve(
  1002. [in] DWORD dwPropId,
  1003. [out] ICategorizerListResolve **ppICategorizerListResolve);
  1004. HRESULT PutICategorizerListResolve(
  1005. [in] DWORD dwPropId,
  1006. [in] ICategorizerListResolve *pICategorizerListResolve);
  1007. HRESULT GetICategorizerMailMsgs(
  1008. [in] DWORD dwPropId,
  1009. [out] ICategorizerMailMsgs **ppICategorizerMailMsgs);
  1010. HRESULT PutICategorizerMailMsgs(
  1011. [in] DWORD dwPropId,
  1012. [in] ICategorizerMailMsgs *pICategorizerMailMsgs);
  1013. HRESULT GetICategorizerItem(
  1014. [in] DWORD dwPropId,
  1015. [out] ICategorizerItem **ppICategorizerItem);
  1016. HRESULT PutICategorizerItem(
  1017. [in] DWORD dwPropId,
  1018. [in] ICategorizerItem *pICategorizerItem);
  1019. HRESULT UnSetPropId(
  1020. [in] DWORD dwPropId);
  1021. };
  1022. //+------------------------------------------------------------
  1023. //
  1024. // Interface: ICategorizerParameters
  1025. //
  1026. // Synopsis: Holds data concerning attribute names for the schema in use
  1027. //
  1028. //
  1029. //-------------------------------------------------------------
  1030. typedef [v1_enum] enum
  1031. {
  1032. DSPARAMETER_LDAPHOST = 0,
  1033. DSPARAMETER_LDAPBINDTYPE,
  1034. DSPARAMETER_LDAPDOMAIN,
  1035. DSPARAMETER_LDAPACCOUNT,
  1036. DSPARAMETER_LDAPPASSWORD,
  1037. DSPARAMETER_LDAPNAMINGCONTEXT,
  1038. DSPARAMETER_LDAPPORT,
  1039. DSPARAMETER_BATCHINGLIMIT,
  1040. DSPARAMETER_SEARCHATTRIBUTE_SMTP,
  1041. DSPARAMETER_SEARCHFILTER_SMTP,
  1042. DSPARAMETER_SEARCHATTRIBUTE_X500,
  1043. DSPARAMETER_SEARCHFILTER_X500,
  1044. DSPARAMETER_SEARCHATTRIBUTE_X400,
  1045. DSPARAMETER_SEARCHFILTER_X400,
  1046. DSPARAMETER_SEARCHATTRIBUTE_LEGACYEXDN,
  1047. DSPARAMETER_SEARCHFILTER_LEGACYEXDN,
  1048. DSPARAMETER_SEARCHATTRIBUTE_RDN,
  1049. DSPARAMETER_SEARCHFILTER_RDN,
  1050. DSPARAMETER_SEARCHATTRIBUTE_DN,
  1051. DSPARAMETER_SEARCHFILTER_DN,
  1052. DSPARAMETER_SEARCHATTRIBUTE_FOREIGNADDRESS,
  1053. DSPARAMETER_SEARCHFILTER_FOREIGNADDRESS,
  1054. DSPARAMETER_ATTRIBUTE_OBJECTCLASS,
  1055. DSPARAMETER_ATTRIBUTE_DEFAULT_SMTP,
  1056. DSPARAMETER_ATTRIBUTE_DEFAULT_X500,
  1057. DSPARAMETER_ATTRIBUTE_DEFAULT_X400,
  1058. DSPARAMETER_ATTRIBUTE_DEFAULT_DN,
  1059. DSPARAMETER_ATTRIBUTE_DEFAULT_LEGACYEXDN,
  1060. DSPARAMETER_ATTRIBUTE_FORWARD_SMTP,
  1061. DSPARAMETER_ATTRIBUTE_DL_MEMBERS,
  1062. DSPARAMETER_ATTRIBUTE_DL_DYNAMICFILTER,
  1063. DSPARAMETER_ATTRIBUTE_DL_DYNAMICBASEDN,
  1064. DSPARAMETER_OBJECTCLASS_USER,
  1065. DSPARAMETER_OBJECTCLASS_DL_X500,
  1066. DSPARAMETER_OBJECTCLASS_DL_SMTP,
  1067. DSPARAMETER_OBJECTCLASS_DL_DYNAMIC,
  1068. DSPARAMETER_ENDENUMMESS,
  1069. DSPARAMETER_INVALID
  1070. } eDSPARAMETER;
  1071. [
  1072. object,
  1073. local,
  1074. uuid(86F9DA7B-EB6E-11d1-9DF3-00C04FA322BA),
  1075. helpstring("ICategorizerParameters Interface"),
  1076. pointer_default(unique)
  1077. ]
  1078. interface ICategorizerParameters : IUnknown
  1079. {
  1080. HRESULT GetDSParameterA(
  1081. [in] DWORD dwDSParameter,
  1082. [out] LPSTR *ppszValue);
  1083. HRESULT SetDSParameterA(
  1084. [in] DWORD dwDSParameter,
  1085. [in, unique] LPCSTR pszValue);
  1086. HRESULT RequestAttributeA(
  1087. [in, unique] LPCSTR pszName);
  1088. HRESULT GetAllAttributes(
  1089. [out] LPSTR **prgszAllAttributes);
  1090. HRESULT ReserveICatItemPropIds(
  1091. [in] DWORD dwNumPropIdsRequested,
  1092. [out] DWORD *pdwBeginningPropId);
  1093. HRESULT ReserveICatListResolvePropIds(
  1094. [in] DWORD dwNumPropIdsRequested,
  1095. [out] DWORD *pdwBeginningPropId);
  1096. HRESULT GetCCatConfigInfo(
  1097. [out] PCCATCONFIGINFO *ppCCatConfigInfo);
  1098. };
  1099. //+------------------------------------------------------------
  1100. //
  1101. // Interface: ICategorizerQueries
  1102. //
  1103. // Synopsis: Interface to an object that holds query strings
  1104. //
  1105. //
  1106. //-------------------------------------------------------------
  1107. [
  1108. object,
  1109. uuid(86F9DA7D-EB6E-11d1-9DF3-00C04FA322BA),
  1110. helpstring("ICategorizerQueries Interface"),
  1111. pointer_default(unique)
  1112. ]
  1113. interface ICategorizerQueries : IUnknown
  1114. {
  1115. HRESULT SetQueryString(
  1116. [in, unique] LPSTR pszQueryString);
  1117. HRESULT GetQueryString(
  1118. [out] LPSTR *ppszQueryString);
  1119. };
  1120. //+------------------------------------------------------------
  1121. //
  1122. // Interface: ICategorizerMailMsgs
  1123. //
  1124. // Synopsis: Interface to hold all MailMsgs associated with a message
  1125. // categorization
  1126. //
  1127. //-------------------------------------------------------------
  1128. //
  1129. // The structure used for mailmsg enumeration
  1130. //
  1131. typedef PVOID CATMAILMSG_ENUMERATOR, *PCATMAILMSG_ENUMERATOR;
  1132. [
  1133. object,
  1134. local,
  1135. uuid(86F9DA80-EB6E-11d1-9DF3-00C04FA322BA),
  1136. helpstring("ICategorizerMailMsgs Interface"),
  1137. pointer_default(unique)
  1138. ]
  1139. interface ICategorizerMailMsgs : IUnknown
  1140. {
  1141. HRESULT GetMailMsg(
  1142. [in] DWORD dwFlags,
  1143. [out] IMailMsgProperties **ppIMailMsgProperties,
  1144. [out] IMailMsgRecipientsAdd **ppIMailMsgRecipientsAdd,
  1145. [out] BOOL *pfCreated);
  1146. HRESULT ReBindMailMsg(
  1147. [in] DWORD dwFlags,
  1148. [in] IUnknown *pStoreDriver);
  1149. //
  1150. // Functions to enumerate all created mailmsg
  1151. //
  1152. HRESULT BeginMailMsgEnumeration(
  1153. [in] PCATMAILMSG_ENUMERATOR penumerator);
  1154. HRESULT GetNextMailMsg(
  1155. [in] PCATMAILMSG_ENUMERATOR penumerator,
  1156. [out] DWORD *pdwFlags,
  1157. [out] IMailMsgProperties **ppIMailMsgProperties,
  1158. [out] IMailMsgRecipientsAdd **ppIMailMsgRecipientsAdd);
  1159. HRESULT EndMailMsgEnumeration(
  1160. [in] PCATMAILMSG_ENUMERATOR penumerator);
  1161. }
  1162. //+------------------------------------------------------------
  1163. //
  1164. // Interface: ICategorizerItemAttributes
  1165. //
  1166. // Synopsis: Sink supplied interface with methods to get at object attributes
  1167. //
  1168. //
  1169. //-------------------------------------------------------------
  1170. //
  1171. // The structure used for attribute enumeration
  1172. //
  1173. typedef struct _tagAttributeEnumerator {
  1174. PVOID pvBase;
  1175. PVOID pvCurrent;
  1176. PVOID pvContext;
  1177. } ATTRIBUTE_ENUMERATOR, *PATTRIBUTE_ENUMERATOR;
  1178. [
  1179. object,
  1180. uuid(86F9DA7F-EB6E-11d1-9DF3-00C04FA322BA),
  1181. helpstring("ICategorizerItemAttributes Interface"),
  1182. pointer_default(unique)
  1183. ]
  1184. interface ICategorizerItemAttributes : IUnknown
  1185. {
  1186. //
  1187. // Functions to enumerate through a specified attribute value
  1188. //
  1189. [local] HRESULT BeginAttributeEnumeration(
  1190. [in, unique] LPCSTR pszAttributeName,
  1191. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1192. [local] HRESULT GetNextAttributeValue(
  1193. [in] PATTRIBUTE_ENUMERATOR penumerator,
  1194. [out] LPSTR *ppszAttributeValue);
  1195. [local] HRESULT RewindAttributeEnumeration(
  1196. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1197. [local] HRESULT EndAttributeEnumeration(
  1198. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1199. //
  1200. // Functions to enumerate through the available attribute names
  1201. //
  1202. [local] HRESULT BeginAttributeNameEnumeration(
  1203. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1204. [local] HRESULT GetNextAttributeName(
  1205. [in] PATTRIBUTE_ENUMERATOR penumerator,
  1206. [out] LPSTR *ppszAttributeName);
  1207. [local] HRESULT EndAttributeNameEnumeration(
  1208. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1209. [local] GUID GetTransportSinkID();
  1210. [local] HRESULT AggregateAttributes(
  1211. [in] ICategorizerItemAttributes *pICatItemAttr);
  1212. //
  1213. // Support to retrieve all attributes at the same time.
  1214. //
  1215. [local] HRESULT GetAllAttributeValues(
  1216. [in, unique] LPCSTR pszAttributeName,
  1217. [in] PATTRIBUTE_ENUMERATOR penumerator,
  1218. [out] LPSTR **prgpszAttributeValues);
  1219. [local] HRESULT ReleaseAllAttributeValues(
  1220. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1221. //
  1222. // Count the attribute values before enumeating
  1223. //
  1224. [local] HRESULT CountAttributeValues(
  1225. [in] PATTRIBUTE_ENUMERATOR penumerator,
  1226. [out] DWORD *pdwCount);
  1227. }
  1228. //+------------------------------------------------------------
  1229. //
  1230. // Interface: ICategorizerItemRawAttributes
  1231. //
  1232. // Synopsis: Sink supplied interface with methods to get at raw object attributes
  1233. //
  1234. //
  1235. //-------------------------------------------------------------
  1236. [
  1237. object,
  1238. uuid(34C3D389-8FA7-11d2-9E16-00C04FA322BA),
  1239. helpstring("ICategorizerItemRawAttributes Interface"),
  1240. pointer_default(unique)
  1241. ]
  1242. interface ICategorizerItemRawAttributes : IUnknown
  1243. {
  1244. //
  1245. // Functions to enumerate through a specified attribute value
  1246. //
  1247. [local] HRESULT BeginRawAttributeEnumeration(
  1248. [in, unique] LPCSTR pszAttributeName,
  1249. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1250. [local] HRESULT GetNextRawAttributeValue(
  1251. [in] PATTRIBUTE_ENUMERATOR penumerator,
  1252. [out] DWORD *pdwcb,
  1253. [out] LPVOID *pvAttributeValue);
  1254. [local] HRESULT RewindRawAttributeEnumeration(
  1255. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1256. [local] HRESULT EndRawAttributeEnumeration(
  1257. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1258. //
  1259. // Count the attribute values before enumeating
  1260. //
  1261. [local] HRESULT CountRawAttributeValues(
  1262. [in] PATTRIBUTE_ENUMERATOR penumerator,
  1263. [out] DWORD *pdwCount);
  1264. }
  1265. //+------------------------------------------------------------
  1266. //
  1267. // Interface: ICategorizerItem
  1268. //
  1269. // Synopsis: A property interface with a number of well known propIDs
  1270. // (below)
  1271. //
  1272. //
  1273. //-------------------------------------------------------------
  1274. typedef [v1_enum] enum
  1275. {
  1276. ICATEGORIZERITEM_SOURCETYPE = 0,
  1277. ICATEGORIZERITEM_LDAPQUERYSTRING,
  1278. ICATEGORIZERITEM_DISTINGUISHINGATTRIBUTE,
  1279. ICATEGORIZERITEM_DISTINGUISHINGATTRIBUTEVALUE,
  1280. ICATEGORIZERITEM_IMAILMSGPROPERTIES,
  1281. ICATEGORIZERITEM_IMAILMSGRECIPIENTSADD,
  1282. ICATEGORIZERITEM_IMAILMSGRECIPIENTSADDINDEX,
  1283. ICATEGORIZERITEM_FPRIMARY,
  1284. ICATEGORIZERITEM_PARENT,
  1285. ICATEGORIZERITEM_ICATEGORIZERITEMATTRIBUTES,
  1286. ICATEGORIZERITEM_HRSTATUS,
  1287. ICATEGORIZERITEM_ICATEGORIZERLISTRESOLVE,
  1288. ICATEGORIZERITEM_ICATEGORIZERMAILMSGS,
  1289. ICATEGORIZERITEM_HRNDRREASON,
  1290. ICATEGORIZERITEM_DWLEVEL,
  1291. ICATEGORIZERITEM_FISRDNSEARCH,
  1292. ICATEGORIZERITEM_ENDENUMMESS
  1293. } eICATEGORIZERITEMPROPID;
  1294. typedef [v1_enum] enum
  1295. {
  1296. SOURCE_SENDER,
  1297. SOURCE_RECIPIENT,
  1298. SOURCE_VERIFY
  1299. } eSourceType;
  1300. [
  1301. local,
  1302. object,
  1303. uuid(86F9DA7C-EB6E-11d1-9DF3-00C04FA322BA),
  1304. helpstring("ICategorizerItem Interface"),
  1305. pointer_default(unique)
  1306. ]
  1307. interface ICategorizerItem : ICategorizerProperties {};
  1308. //+------------------------------------------------------------
  1309. //
  1310. // Interface: ICategorizerAsyncContext
  1311. //
  1312. // Synopsis: Interface handed out to sinks containing async context methods
  1313. //
  1314. //
  1315. //-------------------------------------------------------------
  1316. [
  1317. object,
  1318. uuid(86F9DA7E-EB6E-11d1-9DF3-00C04FA322BA),
  1319. helpstring("ICategorizerAsyncCompletion Interface"),
  1320. pointer_default(unique)
  1321. ]
  1322. interface ICategorizerAsyncContext : IUnknown
  1323. {
  1324. [local] HRESULT CompleteQuery(
  1325. [in] PVOID pvQueryContext,
  1326. [in] HRESULT hrResolutionStatus,
  1327. [in] DWORD dwcResults,
  1328. [in, size_is(dwcResults)] ICategorizerItemAttributes **rgpItemAttributes,
  1329. [in] BOOL fFinalCompletion);
  1330. }
  1331. //+------------------------------------------------------------
  1332. //
  1333. // Interface: ICategorizerListResolve
  1334. //
  1335. // Synopsis: Interface handed out to sinks that can spin off further resolves
  1336. //
  1337. //
  1338. //-------------------------------------------------------------
  1339. [
  1340. object,
  1341. uuid(960252A4-0A3A-11d2-9E00-00C04FA322BA),
  1342. helpstring("ICategorizerListResolve Interface"),
  1343. pointer_default(unique)
  1344. ]
  1345. interface ICategorizerListResolve : IUnknown
  1346. {
  1347. [local] HRESULT AllocICategorizerItem(
  1348. [in] eSourceType SourceType,
  1349. [out] ICategorizerItem **ppICatItem);
  1350. [local] HRESULT ResolveICategorizerItem(
  1351. [in] ICategorizerItem *pICatItem);
  1352. [local] HRESULT SetListResolveStatus(
  1353. [in] HRESULT hrStatus);
  1354. [local] HRESULT GetListResolveStatus(
  1355. [out] HRESULT *phrStatus);
  1356. }
  1357. //+------------------------------------------------------------
  1358. //
  1359. // Interface: IMailTransportCategorize
  1360. //
  1361. // Synopsis: Interface a sink must implement in order to handle
  1362. // categorizer events
  1363. //
  1364. //
  1365. //-------------------------------------------------------------
  1366. [
  1367. object,
  1368. uuid(86F9DA7A-EB6E-11d1-9DF3-00C04FA322BA),
  1369. helpstring("IMailTransportCategorize Interface"),
  1370. pointer_default(unique)
  1371. ]
  1372. interface IMailTransportCategorize : IUnknown
  1373. {
  1374. HRESULT Register(
  1375. [in] ICategorizerParameters *);
  1376. [local] HRESULT BeginMessageCategorization(
  1377. [in] ICategorizerMailMsgs *);
  1378. [local] HRESULT EndMessageCategorization(
  1379. [in] ICategorizerMailMsgs *,
  1380. [in] HRESULT hrCatStatus);
  1381. [local] HRESULT BuildQuery(
  1382. [in] ICategorizerParameters *,
  1383. [in] ICategorizerItem *);
  1384. [local] HRESULT BuildQueries(
  1385. [in] ICategorizerParameters *,
  1386. [in] DWORD dwcAddresses,
  1387. [in, size_is(dwcAddresses)] ICategorizerItem **rgpICategorizerItems,
  1388. [in] ICategorizerQueries *);
  1389. [local] HRESULT SendQuery(
  1390. [in] ICategorizerParameters *,
  1391. [in] ICategorizerQueries *,
  1392. [in] ICategorizerAsyncContext *,
  1393. [in] PVOID pvQueryContext);
  1394. [local] HRESULT SortQueryResult(
  1395. [in] ICategorizerParameters *,
  1396. [in] HRESULT hrResolutionStatus,
  1397. [in] DWORD dwcAddresses,
  1398. [in, size_is(dwcAddresses)] ICategorizerItem **rgpICategorizerItems,
  1399. [in] DWORD dwcResults,
  1400. [in, size_is(dwcResults)] ICategorizerItemAttributes **rgpICategorizerItemAttributes);
  1401. [local] HRESULT ProcessItem(
  1402. [in] ICategorizerParameters *,
  1403. [in] ICategorizerItem *);
  1404. [local] HRESULT ExpandItem(
  1405. [in] ICategorizerParameters *,
  1406. [in] ICategorizerItem *,
  1407. [in] IMailTransportNotify *,
  1408. [in] PVOID);
  1409. [local] HRESULT CompleteItem(
  1410. [in] ICategorizerParameters *,
  1411. [in] ICategorizerItem *);
  1412. };
  1413. //
  1414. // See smtpguid.h for the CLSID and Program ID of the CoCreateable
  1415. // Categorizer
  1416. //
  1417. //+------------------------------------------------------------
  1418. //
  1419. // Interface: ISMTPCategorizer
  1420. //
  1421. // Synopsis: Interface to the SMTP categorizer
  1422. //
  1423. //
  1424. //-------------------------------------------------------------
  1425. [
  1426. object,
  1427. local,
  1428. uuid(B23C35B8-9219-11d2-9E17-00C04FA322BA),
  1429. helpstring("ISMTPCategorizer Interface"),
  1430. pointer_default(unique)
  1431. ]
  1432. interface ISMTPCategorizer : IUnknown
  1433. {
  1434. HRESULT ChangeConfig(
  1435. [in] PCCATCONFIGINFO pConfigInfo);
  1436. HRESULT CatMsg(
  1437. [in] IUnknown *pMsg,
  1438. [in] ISMTPCategorizerCompletion *pICompletion,
  1439. [in] LPVOID pContext);
  1440. HRESULT CatDLMsg(
  1441. [in] IUnknown *pMsg,
  1442. [in] ISMTPCategorizerDLCompletion *pICompletion,
  1443. [in] LPVOID pContext,
  1444. [in] BOOL fMatchOnly,
  1445. [in] CAT_ADDRESS_TYPE CAType,
  1446. [in] LPSTR pszAddress);
  1447. HRESULT CatCancel();
  1448. };
  1449. //+------------------------------------------------------------
  1450. //
  1451. // Interface: ISMTPCategorizerCompletion
  1452. //
  1453. // Synopsis: Async completion interface
  1454. //
  1455. //
  1456. //-------------------------------------------------------------
  1457. [
  1458. object,
  1459. local,
  1460. uuid(B23C35B9-9219-11d2-9E17-00C04FA322BA),
  1461. helpstring("ISMTPCategorizerCompletion Interface"),
  1462. pointer_default(unique)
  1463. ]
  1464. interface ISMTPCategorizerCompletion : IUnknown
  1465. {
  1466. HRESULT CatCompletion(
  1467. HRESULT hr,
  1468. PVOID pContext,
  1469. IUnknown *pImsg,
  1470. IUnknown **rgpImsg);
  1471. };
  1472. //+------------------------------------------------------------
  1473. //
  1474. // Interface: ISMTPCategorizerDLCompletion
  1475. //
  1476. // Synopsis: Async completion interface
  1477. //
  1478. //
  1479. //-------------------------------------------------------------
  1480. [
  1481. object,
  1482. local,
  1483. uuid(B23C35BA-9219-11d2-9E17-00C04FA322BA),
  1484. helpstring("ISMTPCategorizerDLCompletion Interface"),
  1485. pointer_default(unique)
  1486. ]
  1487. interface ISMTPCategorizerDLCompletion : IUnknown
  1488. {
  1489. HRESULT CatDLCompletion(
  1490. HRESULT hr,
  1491. PVOID pContext,
  1492. IUnknown *pImsg,
  1493. BOOL fMatch);
  1494. };
  1495. //---[ eDomainInfoFlags ]------------------------------------------------------
  1496. //
  1497. //
  1498. // Description: Flags used to describe boolean per domain properties
  1499. //
  1500. //-----------------------------------------------------------------------------
  1501. typedef [v1_enum] enum
  1502. {
  1503. //Outbound protocol property flags
  1504. DOMAIN_INFO_REMOTE = 0x00000000, //Default setting
  1505. DOMAIN_INFO_USE_SSL = 0x00000001, //Use SSL on outbound connections
  1506. DOMAIN_INFO_SEND_TURN = 0x00000002, //Send TURN on outbound connections
  1507. DOMAIN_INFO_SEND_ETRN = 0x00000004, //Send ETRN on outbound connections
  1508. DOMAIN_INFO_USE_NTLM = 0x00000008, //Use NTLM auth on outbound
  1509. DOMAIN_INFO_USE_PLAINTEXT = 0x00000010, //Use plaintext auth on outbound
  1510. DOMAIN_INFO_USE_DPA = 0x00000020, //Use DPA auth on outbound
  1511. DOMAIN_INFO_USE_KERBEROS = 0x00000040, //Use Kerberos auth on outbound
  1512. DOMAIN_INFO_USE_CHUNKING = 0x00000080, //Require binary chunking on outbound
  1513. DOMAIN_INFO_DISABLE_CHUNKING = 0x00000100, //For this specific domain disaalow CHUNKING
  1514. DOMAIN_INFO_DISABLE_BMIME = 0x00000200, //For this specific domain disallow BMIME
  1515. DOMAIN_INFO_DISABLE_DSN = 0x00000400, //For this specific domain disallow DSN
  1516. DOMAIN_INFO_DISABLE_PIPELINE = 0x00000800, //For this specific domain disallow PIPElineing
  1517. DOMAIN_INFO_USE_HELO = 0x00001000, //Send HELO instead of EHLO
  1518. //Queueing/Routing flags
  1519. DOMAIN_INFO_TURN_ONLY = 0x00010000, //Create connection only when asked (uses GetNamedConnection)
  1520. DOMAIN_INFO_ETRN_ONLY = 0x00020000, //Do no create connections until told to (uses GetNextConnection)
  1521. DOMAIN_INFO_LOCAL_DROP = 0x00040000, //Local drop domain
  1522. DOMAIN_INFO_LOCAL_MAILBOX = 0x00080000, //Local domain (no drop directory)
  1523. DOMAIN_INFO_REMOTE_SMARTHOST = 0x00100000, //Remote domain with smart host
  1524. DOMAIN_INFO_IP_RELAY = 0x00200000, //Allow Relay based on IP address
  1525. DOMAIN_INFO_AUTH_RELAY = 0x00400000, //Allow Relay based on authentication
  1526. DOMAIN_INFO_DOMAIN_RELAY = 0x00800000, //Allow Relay based on domain name
  1527. DOMAIN_INFO_ALIAS = 0x01000000, //Local alias domain
  1528. DOMAIN_INFO_TURN_ON_EMPTY = 0x02000000, //TURN works on empty conns
  1529. DOMAIN_INFO_INVALID = 0x80000000, //Used for returning "invalid" or "not found" info
  1530. } eDomainInfoFlags ;
  1531. //+------------------------------------------------------------
  1532. //
  1533. // Interface: ICategorizerDomainInfo
  1534. //
  1535. // Synopsis: An interface to retrieve above domain info flags
  1536. // describing a given SMTP domain
  1537. //
  1538. //-------------------------------------------------------------
  1539. [
  1540. object,
  1541. local,
  1542. uuid(E210EDC6-F27D-481f-9DFC-1CA840905FD9),
  1543. helpstring("ICategorizerDomainInfo Interface"),
  1544. pointer_default(unique)
  1545. ]
  1546. interface ICategorizerDomainInfo : IUnknown
  1547. {
  1548. HRESULT GetDomainInfoFlags(
  1549. [in, string] LPSTR szDomainName,
  1550. [out] DWORD *pdwDomainInfoFlags);
  1551. }
  1552. //+------------------------------------------------------------
  1553. //
  1554. // Interfaces pulled in from catintrnl.idl
  1555. //
  1556. interface ICategorizerRequestedAttributes;
  1557. interface ICategorizerLdapConfig;
  1558. interface IServersListInfo;
  1559. //+------------------------------------------------------------
  1560. //
  1561. // Interface: ICategorizerParametersEx
  1562. //
  1563. // Synopsis: ICategorizerParameters plus new methods to retrieve
  1564. // requested attributes, register an interface which may be called
  1565. // to get the list of GCs from dsaccess. Also a "Get" function for
  1566. // the aforementioned interface.
  1567. //
  1568. // History:
  1569. // jstamerj 1999/07/08 14:24:56: Created
  1570. //
  1571. //-------------------------------------------------------------
  1572. [
  1573. object,
  1574. local,
  1575. uuid(E962BA1F-3FB9-11d3-80D7-00C04FA322BA),
  1576. helpstring("ICategorizerParametersEx Interface"),
  1577. pointer_default(unique)
  1578. ]
  1579. interface ICategorizerParametersEx : ICategorizerParameters
  1580. {
  1581. HRESULT GetDSParameterW(
  1582. [in] DWORD dwDSParameter,
  1583. [out] LPWSTR *ppszValue);
  1584. HRESULT GetRequestedAttributes(
  1585. [out] ICategorizerRequestedAttributes **ppIRequestedAttributes);
  1586. HRESULT RegisterCatLdapConfigInterface(
  1587. [out] ICategorizerLdapConfig *pICategorizerLdapConfig);
  1588. HRESULT GetLdapConfigInterface(
  1589. [out] ICategorizerLdapConfig **ppICatLdapConfigInfo);
  1590. };
  1591. //+------------------------------------------------------------
  1592. //
  1593. // Interface: ICategorizerRequestedAttributes
  1594. //
  1595. // Synopsis: Contains a read-only method to retrieve all the requested
  1596. // attributes
  1597. //
  1598. // History:
  1599. // jstamerj 1999/07/08 14:24:56: Created
  1600. //
  1601. //-------------------------------------------------------------
  1602. [
  1603. object,
  1604. local,
  1605. uuid(CB0924E0-357B-11d3-8328-00C04FA322BA),
  1606. helpstring("ICategorizerRequestedAttributes Interface"),
  1607. pointer_default(unique)
  1608. ]
  1609. interface ICategorizerRequestedAttributes : IUnknown
  1610. {
  1611. HRESULT GetAllAttributes(
  1612. [out] LPSTR **prgszAllAttributes);
  1613. HRESULT GetAllAttributesW(
  1614. [out] LPWSTR **prgszAllAttributes);
  1615. };
  1616. //+------------------------------------------------------------
  1617. //
  1618. // Interface: ICategorizerUTF8Attributes
  1619. //
  1620. // Synopsis: Methods to retrieve attributes as UTF8 strings
  1621. //
  1622. // History:
  1623. // jstamerj 1999/07/08 14:24:56: Created
  1624. //
  1625. //-------------------------------------------------------------
  1626. [
  1627. object,
  1628. local,
  1629. uuid(BEBF931D-17E0-4ec8-BC1C-CC3286D72CB7),
  1630. helpstring("ICategorizerUTF8Attributes Interface"),
  1631. pointer_default(unique)
  1632. ]
  1633. interface ICategorizerUTF8Attributes : IUnknown
  1634. {
  1635. [local] HRESULT BeginUTF8AttributeEnumeration(
  1636. [in, unique] LPCSTR pszAttributeName,
  1637. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1638. [local] HRESULT GetNextUTF8AttributeValue(
  1639. [in] PATTRIBUTE_ENUMERATOR penumerator,
  1640. [out] LPSTR *ppszAttributeValue);
  1641. [local] HRESULT RewindUTF8AttributeEnumeration(
  1642. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1643. [local] HRESULT EndUTF8AttributeEnumeration(
  1644. [in] PATTRIBUTE_ENUMERATOR penumerator);
  1645. [local] HRESULT CountUTF8AttributeValues(
  1646. [in] PATTRIBUTE_ENUMERATOR penumerator,
  1647. [out] DWORD *pdwCount);
  1648. };
  1649. //+------------------------------------------------------------
  1650. //
  1651. // Interface: ICategorizerLdapConfig
  1652. //
  1653. // Synopsis: Contains a function that may be queried for the GCs
  1654. // on the machine as discovered by dsaccess (or as read from the
  1655. // registry by dsaccess).
  1656. //
  1657. // History:
  1658. // gpulla created
  1659. //
  1660. //-------------------------------------------------------------
  1661. [
  1662. object,
  1663. local,
  1664. uuid(27C1B2D3-1A28-4b90-BC0A-E52057D30712),
  1665. helpstring("ICategorizerLdapConfig Interface"),
  1666. pointer_default(unique)
  1667. ]
  1668. interface ICategorizerLdapConfig : IUnknown
  1669. {
  1670. HRESULT GetGCServers(
  1671. [out] IServersListInfo **pIServersListInfo);
  1672. };
  1673. //+------------------------------------------------------------
  1674. //
  1675. // Interface: IServersListInfo
  1676. //
  1677. // Synopsis: Interface to an object encapsulating the list of
  1678. // GCs described above. Functions allow querying the number of
  1679. // GCs and enumerating through the GCs.
  1680. //
  1681. // History:
  1682. // gpulla created
  1683. //
  1684. //-------------------------------------------------------------
  1685. [
  1686. object,
  1687. local,
  1688. uuid(C54CEA94-E501-4f34-8704-F5881EA5CBF4),
  1689. helpstring("IServersListInfo Interface"),
  1690. pointer_default(unique)
  1691. ]
  1692. interface IServersListInfo : IUnknown
  1693. {
  1694. HRESULT GetNumGC(
  1695. [out] DWORD *dwGC);
  1696. HRESULT GetItem(
  1697. [in] DWORD dwIdx,
  1698. [out] DWORD *dwPort,
  1699. [out] LPSTR *pszServerName);
  1700. };
  1701. //-----------------------------------------------------------------------------
  1702. // DSN Event Interfaces
  1703. //-----------------------------------------------------------------------------
  1704. //---[ eDSNActions ]-----------------------------------------------------------
  1705. //
  1706. //
  1707. // Description: Possible actions for DSN Generation events
  1708. //
  1709. //
  1710. //-----------------------------------------------------------------------------
  1711. typedef [v1_enum] enum
  1712. {
  1713. DSN_ACTION_FAILURE = 0x00000001, //Generate a FAILURE DSN for FAILED recips
  1714. DSN_ACTION_FAILURE_ALL = 0x00000002, //Generate a FAILURE DSN for UNDELIVERED and FAILED recips
  1715. DSN_ACTION_DELAYED = 0x00000004, //Generate a DELAY DSN for undelivered recips
  1716. DSN_ACTION_RELAYED = 0x00000008, //Generate a RELAY DSN for delivered recips
  1717. DSN_ACTION_EXPANDED = 0x00000010, //Generate a EXPANDED DSN for expanded
  1718. DSN_ACTION_DELIVERED = 0x00000020, //Generate a DELIVERED DSN for delivered recips
  1719. DSN_ACTION_TYPE_MASK = 0x0000003F, //Mask for the bits describing the type of DSN
  1720. DSN_ACTION_IGNORE_RET = 0x00000400, //Ignore RET and use Default specified
  1721. DSN_ACTION_CONTEXT_STORE= 0x00100000, //DSN is being generated because of store
  1722. DSN_ACTION_CONTEXT_CAT = 0x00200000, //DSN is being generated because of cat
  1723. DSN_ACTION_CONTEXT_MTA = 0x00400000, //DSN is being generated becuase of mta
  1724. } eDSNActions ;
  1725. //---[ eDSNRETType ]-----------------------------------------------------------
  1726. //
  1727. //
  1728. // Description: Possible DSN return types
  1729. //
  1730. //
  1731. //-----------------------------------------------------------------------------
  1732. typedef [v1_enum] enum
  1733. {
  1734. // Return the full message
  1735. DSN_RET_FULL = 1,
  1736. // Return the original headers
  1737. DSN_RET_HDRS,
  1738. // Return some of the original headers (much cheaper, but not RFC compliant)
  1739. DSN_RET_PARTIAL_HDRS,
  1740. } eDSNRETType;
  1741. //---[ eDSNProperties ]--------------------------------------------------------
  1742. //
  1743. //
  1744. // Description: Property IDs for DSN property bag
  1745. //
  1746. //
  1747. //-----------------------------------------------------------------------------
  1748. typedef [v1_enum] enum
  1749. {
  1750. //
  1751. // Status codes for DSN generation
  1752. //
  1753. DSNPROP_DW_DSNACTIONS = 1,
  1754. DSNPROP_DW_DSNOPTIONS,
  1755. DSNPROP_DW_RFC821STATUS,
  1756. DSNPROP_DW_HRSTATUS,
  1757. //
  1758. // Text to use in DSN generation text
  1759. //
  1760. DSNPROP_SZ_DEFAULTDOMAIN,
  1761. DSNPROP_SZ_REPORTINGMTA,
  1762. DSNPROP_SZ_REPORTINGMTATYPE,
  1763. DSNPROP_SZ_DSNCONTEXT, // For X-DSNContext header
  1764. //
  1765. // Preferred language
  1766. //
  1767. DSNPROP_DW_LANGID,
  1768. //
  1769. // SMTP address to receive a copy of NDRs
  1770. //
  1771. DSNPROP_SZ_COPYNDRTO,
  1772. //
  1773. // Expire time
  1774. //
  1775. DSNPROP_FT_EXPIRETIME,
  1776. //
  1777. // Custom text to insert before human readable part of DSN
  1778. //
  1779. DSNPROP_SZ_HR_TOP_CUSTOM_TEXT_A, // Ascii text
  1780. DSNPROP_SZ_HR_TOP_CUSTOM_TEXT_W, // Unicode text
  1781. //
  1782. // Custom text to insert after human readable part of DSN
  1783. //
  1784. DSNPROP_SZ_HR_BOTTOM_CUSTOM_TEXT_A, // Ascii text
  1785. DSNPROP_SZ_HR_BOTTOM_CUSTOM_TEXT_W, // Unicode text
  1786. //
  1787. // If set to TRUE, message will be copied to badmail
  1788. // (ie. an NDR an NDR was to be generated)
  1789. //
  1790. DSNPROP_F_BADMAIL_MSG,
  1791. //
  1792. // On errors, return status to aqueue here
  1793. //
  1794. DSNPROP_DW_HR_RETURN_STATUS,
  1795. //
  1796. // The return type of the original message
  1797. //
  1798. DSNPROP_DW_RET_TYPE,
  1799. //
  1800. // Value for the X-Content-Failrue header (HRESULT)
  1801. //
  1802. DSNPROP_DW_CONTENT_FAILURE,
  1803. } eDSNProperties;
  1804. //---[ eDSNOptions ]-----------------------------------------------------------
  1805. //
  1806. //
  1807. // Description:
  1808. // Options flags for DSN options passed into AQueue.
  1809. // See aqueue.idl for definiton of DSN options
  1810. // These options should be moved to smtpevent.idl
  1811. //
  1812. //-----------------------------------------------------------------------------
  1813. // typedef [v1_enum] enum
  1814. // {
  1815. // DSN_OPTIONS_DEFAULT = 0x00000000,
  1816. // DSN_OPTIONS_IGNORE_MSG_RET = 0x00000004,
  1817. // DSN_OPTIONS_SEND_DELAY_DEFAULT = 0x00000008,
  1818. // DSN_OPTIONS_SEND_DELAY_UPON_REQUEST = 0x00000010,
  1819. // DSN_OPTIONS_SEND_DELAY_NEVER = 0x00000020,
  1820. // } eDSNOptions;
  1821. interface IDSNRecipientIterator;
  1822. interface IDSNSubmission;
  1823. //+------------------------------------------------------------
  1824. //
  1825. // Interface: IDSNGenerationSink
  1826. //
  1827. // Synopsis: Sink implemented methods to control DSN generation
  1828. //
  1829. // History:
  1830. // jstamerj 2000/11/05 23:34:01: Created
  1831. //
  1832. //-------------------------------------------------------------
  1833. [
  1834. object,
  1835. uuid(3A513AB9-339D-4589-A137-D54C5F520E6F),
  1836. helpstring("IDSNGenerationSink Interface"),
  1837. pointer_default(unique)
  1838. ]
  1839. interface IDSNGenerationSink : IUnknown
  1840. {
  1841. //
  1842. // Called just once after the sink is created.
  1843. // If an error is returned, sink creation fails.
  1844. //
  1845. HRESULT OnSyncSinkInit(
  1846. [in] DWORD dwVSID);
  1847. //
  1848. // DSN Event.
  1849. // Called to get the DSN recipient iterator interface.
  1850. // The recipient iterator interface returns the recipient indicies
  1851. // and DSN actions for recipents that should be in the DSN.
  1852. //
  1853. // pRecipIterIN is the system's current recipient iterator
  1854. // interface (the interface returned by the last sink called)
  1855. // Sinks can capture and aggregate pRecipIterIN if desired.
  1856. // ppRecipIterOUT is the return parameter for the sink's recip
  1857. // iterator interface. If a sink does not wish to return a
  1858. // recip iterator interface, this paramter can be left NULL. If a
  1859. // sink does return a recip iter interface in *ppIREcipIterOut,
  1860. // then the sink must add a reference count for the caller (call
  1861. // AddRef() before returning the interface).
  1862. //
  1863. HRESULT OnSyncGetDSNRecipientIterator(
  1864. [in] ISMTPServer *pISMTPServer,
  1865. [in] IMailMsgProperties *pIMsg,
  1866. [in] IMailMsgPropertyBag *pIDSNProperties,
  1867. [in] DWORD dwStartDomain,
  1868. [in] DWORD dwDSNActions,
  1869. [in] IDSNRecipientIterator *pIRecipIterIN,
  1870. [out] IDSNRecipientIterator **ppIRecipIterOUT);
  1871. //
  1872. // DSN Event.
  1873. // Called to generate DSN mailmsg(s). The new messages should be
  1874. // submitted back to SMTPSVC using IDSNSubmission.
  1875. // Sinks should complete synchronously. Sink should not use these
  1876. // interface pointers after OnSyncGenerateDSN has returned.
  1877. //
  1878. HRESULT OnSyncGenerateDSN(
  1879. [in] ISMTPServer *pISMTPServer,
  1880. [in] IDSNSubmission *pIDSNSubmission,
  1881. [in] IMailMsgProperties *pIMsg,
  1882. [in] IMailMsgPropertyBag *pIDSNProperties,
  1883. [in] IDSNRecipientIterator *pIRecipIter);
  1884. //
  1885. // Post DSN event.
  1886. // Called for created DSNs that are submitted back to the
  1887. // transport.
  1888. // Sinks should complete synchronously. Sink should not use these
  1889. // interface pointers after OnSyncPostGenerateDSN has returned.
  1890. //
  1891. HRESULT OnSyncPostGenerateDSN(
  1892. [in] ISMTPServer *pISMTPServer,
  1893. [in] IMailMsgProperties *pIMsgOrig,
  1894. [in] DWORD dwDSNAction,
  1895. [in] DWORD cRecipsDSNd,
  1896. [in] IMailMsgProperties *pIMsgDSN,
  1897. [in] IMailMsgPropertyBag *pIDSNProperties);
  1898. };
  1899. //+------------------------------------------------------------
  1900. //
  1901. // Interface: IDSNRecipientIterator
  1902. //
  1903. // Synopsis: Iterates through recipients for which a DSN should be
  1904. // generated.
  1905. //
  1906. // History:
  1907. // jstamerj 2000/11/05 23:49:01: Created
  1908. //
  1909. //-------------------------------------------------------------
  1910. [
  1911. object,
  1912. uuid(1D45C98A-56A0-4fe8-BF33-8986EEB85B63),
  1913. helpstring("IDSNRecipientIterator Interface"),
  1914. pointer_default(unique)
  1915. ]
  1916. interface IDSNRecipientIterator : IUnknown
  1917. {
  1918. //
  1919. // Restart recipient iteration from the beginning
  1920. //
  1921. HRESULT HrReset();
  1922. //
  1923. // Get the next recipient for which a DSN should be generated
  1924. // This will return HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS) to
  1925. // indicate there are no more recipients.
  1926. //
  1927. HRESULT HrGetNextRecipient(
  1928. [out] DWORD *piRecipient,
  1929. [out] DWORD *pdwDSNAction);
  1930. //
  1931. // Mark the recipient so that it will be skipped in further
  1932. // iterations (no further DSNs will be generated.
  1933. //
  1934. HRESULT HrNotifyActionHandled(
  1935. [in] DWORD iRecipient,
  1936. [in] DWORD dwDSNAction);
  1937. };
  1938. //+------------------------------------------------------------
  1939. //
  1940. // Interface: IDSNSubmission
  1941. //
  1942. // Synopsis: Callback interface for a sink to submit a DSN to the
  1943. // system DURING OnSyncGenerateDSN. This interface may not
  1944. // be used after the event has completed.
  1945. //
  1946. // History:
  1947. // jstamerj 2000/12/08 13:28:09: Created
  1948. //
  1949. //-------------------------------------------------------------
  1950. [
  1951. object,
  1952. uuid(C016B75D-CE65-496f-A2C9-B487C83C0F6B),
  1953. helpstring("IDSNSubmission Interface"),
  1954. pointer_default(unique),
  1955. local
  1956. ]
  1957. interface IDSNSubmission : IUnknown
  1958. {
  1959. //
  1960. // Allocate a Bound Message
  1961. // phContent is managed by mailmsg, so the caller should not
  1962. // release this handle.
  1963. //
  1964. HRESULT HrAllocBoundMessage(
  1965. [out] IMailMsgProperties **ppMsg,
  1966. [out] PFIO_CONTEXT *phContent);
  1967. //
  1968. // Submit a DSN to the system
  1969. //
  1970. HRESULT HrSubmitDSN(
  1971. [in] DWORD dwDSNAction,
  1972. [in] DWORD cRecipsDSNd,
  1973. [in] IMailMsgProperties *pDSNMsg);
  1974. };
  1975. cpp_quote("#endif //__SMTPEVENT_H__")