2 * Copyright 2006 Robert Shearman for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 interface IInternetTransport;
22 interface ISMTPTransport;
23 interface IPOP3Transport;
27 cpp_quote("DEFINE_GUID(CLSID_IInternetMessageUrl, 0xca30cc91, 0xb1b3, 0x11d0, 0x85, 0xd0, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
28 cpp_quote("DEFINE_GUID(CLSID_ISMTPTransport, 0xfd853ce6, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
29 cpp_quote("DEFINE_GUID(CLSID_IPOP3Transport, 0xfd853ce7, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
30 cpp_quote("DEFINE_GUID(CLSID_INNTPTransport, 0xfd853ce8, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
31 cpp_quote("DEFINE_GUID(CLSID_IRASTransport, 0xfd853ce9, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
32 cpp_quote("DEFINE_GUID(CLSID_IRangeList, 0xfd853cea, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
33 cpp_quote("DEFINE_GUID(CLSID_IIMAPTransport, 0xfd853ceb, 0x7f86, 0x11d0, 0x82, 0x52, 0x00, 0xc0, 0x4f, 0xd8, 0x5a, 0xb4);")
34 cpp_quote("DEFINE_GUID(CLSID_IHTTPMailTransport, 0x5a580c11, 0xe5eb, 0x11d1, 0xa8, 0x6e, 0x00, 0x00, 0xf8, 0x08, 0x4f, 0x96);")
35 cpp_quote("DEFINE_GUID(CLSID_IPropFindRequest, 0xbb847b8a, 0x054a, 0x11d2, 0xa8, 0x94, 0x00, 0x00, 0xf8, 0x08, 0x4f, 0x96);")
36 cpp_quote("DEFINE_GUID(CLSID_IPropPatchRequest, 0xea678830, 0x235d, 0x11d2, 0xa8, 0xb6, 0x00, 0x00, 0xf8, 0x08, 0x4f, 0x96);")
40 cpp_quote("#ifndef HR_E")
41 cpp_quote("#define HR_E(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_INTERNET, n)")
43 cpp_quote("#ifndef HR_S")
44 cpp_quote("#define HR_S(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_INTERNET, n)")
47 /* General Error Codes */
48 cpp_quote("#define IXP_E_LOAD_SICILY_FAILED HR_E(0xCC00)")
49 cpp_quote("#define IXP_E_INVALID_CERT_CN HR_E(0xCC01)")
50 cpp_quote("#define IXP_E_INVALID_CERT_DATE HR_E(0xCC02)")
51 cpp_quote("#define IXP_E_ALREADY_CONNECTED HR_E(0xCC03)")
52 cpp_quote("#define IXP_E_CONN HR_E(0xCC04)")
53 cpp_quote("#define IXP_E_NOT_CONNECTED HR_E(0xCC05)")
54 cpp_quote("#define IXP_E_CONN_SEND HR_E(0xCC06)")
55 cpp_quote("#define IXP_E_WOULD_BLOCK HR_E(0xCC07)")
56 cpp_quote("#define IXP_E_INVALID_STATE HR_E(0xCC08)")
57 cpp_quote("#define IXP_E_CONN_RECV HR_E(0xCC09)")
58 cpp_quote("#define IXP_E_INCOMPLETE HR_E(0xCC0A)")
59 cpp_quote("#define IXP_E_BUSY HR_E(0xCC0B)")
60 cpp_quote("#define IXP_E_NOT_INIT HR_E(0xCC0C)")
61 cpp_quote("#define IXP_E_CANT_FIND_HOST HR_E(0xCC0D)")
62 cpp_quote("#define IXP_E_FAILED_TO_CONNECT HR_E(0xCC0E)")
63 cpp_quote("#define IXP_E_CONNECTION_DROPPED HR_E(0xCC0F)")
64 cpp_quote("#define IXP_E_INVALID_ADDRESS HR_E(0xCC10)")
65 cpp_quote("#define IXP_E_INVALID_ADDRESS_LIST HR_E(0xCC11)")
66 cpp_quote("#define IXP_E_SOCKET_READ_ERROR HR_E(0xCC12)")
67 cpp_quote("#define IXP_E_SOCKET_WRITE_ERROR HR_E(0xCC13)")
68 cpp_quote("#define IXP_E_SCOKET_INIT_ERROR HR_E(0xCC14)")
69 cpp_quote("#define IXP_E_SOCKET_CONNECT_ERROR HR_E(0xCC15)")
70 cpp_quote("#define IXP_E_INVALID_ACCOUNT HR_E(0xCC16)")
71 cpp_quote("#define IXP_E_USER_CANCEL HR_E(0xCC17)")
72 cpp_quote("#define IXP_E_SICILY_LOGON_FAILED HR_E(0xCC18)")
73 cpp_quote("#define IXP_E_TIMEOUT HR_E(0xCC19)")
74 cpp_quote("#define IXP_E_SECURE_CONNECT_FAILED HR_E(0xCC1A)")
76 /* SMTP Failure Statuses */
77 cpp_quote("#define IXP_E_SMTP_RESPONSE_ERROR HR_E(0xCC60)")
78 cpp_quote("#define IXP_E_SMTP_UNKNOWN_RESPONSE_CODE HR_E(0xCC61)")
79 cpp_quote("#define IXP_E_SMTP_500_SYNTAX_ERROR HR_E(0xCC62)")
80 cpp_quote("#define IXP_E_SMTP_501_PARAM_SYNTAX HR_E(0xCC63)")
81 cpp_quote("#define IXP_E_SMTP_502_COMMAND_NOTIMPL HR_E(0xCC64)")
82 cpp_quote("#define IXP_E_SMTP_503_COMMAND_SEQ HR_E(0xCC65)")
83 cpp_quote("#define IXP_E_SMTP_504_COMMAND_PARAM_NOTIMPL HR_E(0xCC66)")
84 cpp_quote("#define IXP_E_SMTP_421_NOT_AVAILABLE HR_E(0xCC67)")
85 cpp_quote("#define IXP_E_SMTP_450_MAILBOX_BUSY HR_E(0xCC68)")
86 cpp_quote("#define IXP_E_SMTP_550_MAILBOX_NOT_FOUND HR_E(0xCC69)")
87 cpp_quote("#define IXP_E_SMTP_451_ERROR_PROCESSING HR_E(0xCC6A)")
88 cpp_quote("#define IXP_E_SMTP_551_USER_NOT_LOCAL HR_E(0xCC6B)")
89 cpp_quote("#define IXP_E_SMTP_452_NO_SYSTEM_STORAGE HR_E(0xCC6C)")
90 cpp_quote("#define IXP_E_SMTP_552_STORAGE_OVERFLOW HR_E(0xCC6D)")
91 cpp_quote("#define IXP_E_SMTP_553_MAILBOX_NAME_SYNTAX HR_E(0xCC6E)")
92 cpp_quote("#define IXP_E_SMTP_554_TRANSACT_FAILED HR_E(0xCC6F)")
94 /* SMTP Success Statuses */
95 cpp_quote("#define IXP_E_SMTP_211_SYSTEM_STATUS HR_S(0xCC70)")
96 cpp_quote("#define IXP_E_SMTP_214_HELP_MESSAGE HR_S(0xCC71)")
97 cpp_quote("#define IXP_E_SMTP_220_READY HR_S(0xCC72)")
98 cpp_quote("#define IXP_E_SMTP_221_CLOSING HR_S(0xCC73)")
99 cpp_quote("#define IXP_E_SMTP_250_MAIL_ACTION_OKAY HR_S(0xCC74)")
100 cpp_quote("#define IXP_E_SMTP_251_FORWARDING_MAIL HR_S(0xCC75)")
101 cpp_quote("#define IXP_E_SMTP_354_START_MAIL_INPUT HR_S(0xCC76)")
102 cpp_quote("#define IXP_E_SMTP_CONTINUE HR_S(0xCC77)")
103 cpp_quote("#define IXP_E_SMTP_334_AUTH_READY_RESPONSE HR_S(0xCC78)")
104 cpp_quote("#define IXP_E_SMTP_245_AUTH_SUCCESS HR_S(0xCC79)")
106 /* More SMTP Failure Statuses */
107 cpp_quote("#define IXP_E_SMTP_REJECTED_SENDER HR_E(0xCC78)")
108 cpp_quote("#define IXP_E_SMTP_REJECTED_RECIPIENTS HR_E(0xCC79)")
109 cpp_quote("#define IXP_E_SMTP_NO_SENDER HR_E(0xCC7A)")
110 cpp_quote("#define IXP_E_SMTP_NO_RECIPIENTS HR_E(0xCC7B)")
111 cpp_quote("#define IXP_E_SMTP_530_STARTTLS_REQUIRED HR_E(0xCC7C)")
112 cpp_quote("#define IXP_E_SMTP_NO_STARTTLS_SUPPORT HR_E(0xCC7D)")
113 cpp_quote("#define IXP_E_SMTP_NO_DSN_SUPPORT HR_E(0xCC7E)")
114 cpp_quote("#define IXP_E_SMTP_454_STARTTLS_FAILED HR_E(0xCC7F)")
116 const SHORT CCHMAX_DOMAIN = 256;
117 const SHORT CCHMAX_PHONE_NUMBER = 128;
119 const DWORD DEFAULT_IMAP_PORT = 143;
120 const DWORD DEFAULT_POP3_PORT = 110;
121 const DWORD DEFAULT_SMTP_PORT = 25;
122 const DWORD DEFAULT_NNTP_PORT = 119;
124 typedef enum tagINETADDRTYPE
129 ADDR_DSN_SUCCESS = 32,
130 ADDR_DSN_FAILURE = 64,
134 const DWORD ADDR_TOFROM_MASK = 0x1;
135 const DWORD ADDR_DSN_MASK = 0xf0;
137 typedef enum tagDSNRET
144 typedef struct tagINETADDR
146 INETADDRTYPE addrtype;
147 CHAR szEmail[CCHMAX_EMAIL_ADDRESS];
148 } INETADDR, *LPINETADDR;
150 typedef struct tagINETADDRLIST
153 LPINETADDR prgAddress;
154 } INETADDRLIST, *LPINETADDRLIST;
156 typedef enum tagRASCONNTYPE
163 typedef enum tagHTTPMAILPROPTYPE
165 HTTPMAIL_PROP_INVALID,
167 HTTPMAIL_PROP_CONTACTS,
169 HTTPMAIL_PROP_OUTBOX,
170 HTTPMAIL_PROP_SENDMSG,
171 HTTPMAIL_PROP_SENTITEMS,
172 HTTPMAIL_PROP_DELETEDITEMS,
173 HTTPMAIL_PROP_DRAFTS,
174 HTTPMAIL_PROP_MSGFOLDERROOT,
179 typedef enum tagHTTPMAILSPECIALFOLDER
182 HTTPMAIL_SF_UNRECOGNIZED,
184 HTTPMAIL_SF_DELETEDITEMS,
187 HTTPMAIL_SF_SENTITEMS,
188 HTTPMAIL_SF_CONTACTS,
189 HTTPMAIL_SF_CALENDAR,
190 HTTPMAIL_SF_MSNPROMO,
192 } HTTPMAILSPECIALFOLDER;
194 typedef enum tagHTTPMAILCONTACTTYPE
199 } HTTPMAILCONTACTTYPE;
201 const DWORD DAVNAMESPACE_UNKNOWN = 0xFFFFFFFF;
202 const DWORD DAVNAMESPACE_DAV = 0;
203 const DWORD DAVNAMESPACE_HOTMAIL = 1;
204 const DWORD DAVNAMESPACE_HTTPMAIL = 2;
205 const DWORD DAVNAMESPACE_MAIL = 3;
206 const DWORD DAVNAMESPACE_CONTACTS = 4;
208 cpp_quote("#define ISF_SMTP_USEIPFORHELO 0x01")
209 cpp_quote("#define ISF_ALWAYSPROMPTFORPASSWORD 0x02")
210 /* for SMTP - send EHLO and use STARTTLS if available: */
211 cpp_quote("#define ISF_SSLONSAMEPORT 0x04")
212 cpp_quote("#define ISF_QUERYDSNSUPPORT 0x08")
213 /* for SMTP - send EHLO and use AUTH if available: */
214 cpp_quote("#define ISF_QUERYAUTHSUPPORT 0x10")
216 typedef struct INETSERVER
218 CHAR szAccount[CCHMAX_ACCOUNT_NAME];
219 CHAR szUserName[CCHMAX_USERNAME];
220 CHAR szPassword[CCHMAX_PASSWORD];
221 CHAR szServerName[CCHMAX_SERVER_NAME];
222 CHAR szConnectoid[CCHMAX_CONNECTOID];
223 RASCONNTYPE rasconntype;
229 } INETSERVER, *LPINETSERVER;
231 typedef enum tagIXPTYPE
241 typedef enum tagIXPSTATUS
255 const DWORD DEPTH_INFINITY = 0xFFFFFFFE;
257 typedef DWORD MEMBERINFOFLAGS;
259 const MEMBERINFOFLAGS HTTP_MEMBERINFO_COMMONPROPS = 0x0;
260 const MEMBERINFOFLAGS HTTP_MEMBERINFO_FOLDERPROPS = 0x1;
261 const MEMBERINFOFLAGS HTTP_MEMBERINFO_MESSAGEPROPS = 0x2;
262 const MEMBERINFOFLAGS HTTP_MEMBERINFO_ALLPROPS = HTTP_MEMBERINFO_FOLDERPROPS | HTTP_MEMBERINFO_MESSAGEPROPS;
264 typedef DWORD IMAP_MSGFLAGS;
266 const IMAP_MSGFLAGS IMAP_MSG_NOFLAGS = 0x00;
267 const IMAP_MSGFLAGS IMAP_MSG_ANSWERED = 0x01;
268 const IMAP_MSGFLAGS IMAP_MSG_FLAGGED = 0x02;
269 const IMAP_MSGFLAGS IMAP_MSG_DELETED = 0x04;
270 const IMAP_MSGFLAGS IMAP_MSG_SEEN = 0x08;
271 const IMAP_MSGFLAGS IMAP_MSG_DRAFT = 0x10;
272 const IMAP_MSGFLAGS IMAP_MSG_ALLFLAGS = 0x1f;
276 uuid(CA30F3FF-C9AC-11D1-9A3A-00C04FA309D4),
279 interface ITransportCallbackService : IUnknown
281 HRESULT GetParentWindow(
282 [in] DWORD dwReserved,
283 [out] HWND *phwndParent);
286 [out] LPDWORD pdwServerType,
287 [out] IImnAccount **ppAccount);
292 uuid(0DF2C7E1-3435-11D0-81D0-00C04FD85AB4),
295 interface ITransportCallback : IUnknown
297 typedef struct tagIXPRESULT
302 HRESULT hrServerError;
305 } IXPRESULT, *LPIXPRESULT;
307 typedef enum tagCMDTYPE
314 [in,out] DWORD *pdwTimeout,
315 [in] IInternetTransport *pTransport);
317 HRESULT OnLogonPrompt(
318 [in,out] LPINETSERVER pInetServer,
319 [in] IInternetTransport *pTransport);
322 [in] HRESULT hrError,
324 [in] LPCSTR pszCaption,
326 [in] IInternetTransport *pTransport);
329 [in] IXPSTATUS ixpstatus,
330 [in] IInternetTransport *pTransport);
333 [in] IXPSTATUS ixpstatus,
334 [in] LPIXPRESULT pResult,
335 [in] IInternetTransport *pTransport);
338 [in] CMDTYPE cmdtype,
340 [in] HRESULT hrResponse,
341 [in] IInternetTransport *pTransport);
346 uuid(1F636C01-364E-11D0-81D3-00C04FD85AB4),
349 interface IInternetTransport : IUnknown
351 const boolean iitAUTHENTICATE = TRUE;
352 const boolean iitDONT_AUTHENTICATe = FALSE;
353 const boolean iitENABLE_ONCOMMAND = TRUE;
354 const boolean iitDISABLE_ONCOMMAND = FALSE;
356 typedef enum tagIXPISSTATE
364 HRESULT GetServerInfo(
365 [in,out] LPINETSERVER pInetServer);
367 IXPTYPE GetIXPType();
370 [in] IXPISSTATE isstate);
372 HRESULT InetServerFromAccount(
373 [in] IImnAccount *pAccount,
374 [in,out] LPINETSERVER pInetServer);
377 [in] LPINETSERVER pInetServer,
378 [in] boolean fAuthenticate,
379 [in] boolean fCommandLogging);
381 HRESULT HandsOffCallback();
383 HRESULT Disconnect();
385 HRESULT DropConnection();
388 [out] IXPSTATUS *pCurrentStatus);
393 uuid(1F636C02-364E-11D0-81D3-00C04FD85AB4),
396 interface ISMTPCallback : ITransportCallback
398 typedef enum tagSMTPCOMMAND
417 typedef struct tagSMTPSTREAM
422 } SMTPSTREAM, *LPSMTPSTREAM;
424 typedef struct tagSMTPRESPONSE
428 IXPRESULT rIxpResult;
429 ISMTPTransport *pTransport;
431 [switch_type(SMTPCOMMAND), switch_is(command)]
434 [case(SMTP_SEND_STREAM)] SMTPSTREAM rStreamInfo;
437 } SMTPRESPONSE, *LPSMTPRESPONSE;
440 [in] LPSMTPRESPONSE pResponse);
445 uuid(0DF2C7E2-3435-11D0-81D0-00C04FD85AB4),
448 interface ISMTPTransport : IInternetTransport
450 typedef struct tagSMTPMESSAGE
454 INETADDRLIST rAddressList;
455 } SMTPMESSAGE, *LPSMTPMESSAGE;
458 [in] LPSTR pszLogFilePath,
459 [in] ISMTPCallback *pCallback);
461 cpp_quote("#ifdef WINE_NO_UNICODE_MACROS")
462 cpp_quote("#undef SendMessage")
466 [in] LPSMTPMESSAGE pMessage);
469 [in] LPSTR pszEmailFrom);
472 [in] LPSTR pszEmailTo);
474 HRESULT CommandEHLO();
476 HRESULT CommandHELO();
479 [in] LPSTR pszAuthType);
481 HRESULT CommandQUIT();
483 HRESULT CommandRSET();
485 HRESULT CommandDATA();
487 HRESULT CommandDOT();
489 HRESULT SendDataStream(
490 [in] IStream *pStream,
496 uuid(0DF2C7EC-3435-11D0-81D0-00C04FD85AB4),
499 interface ISMTPTransport2 : ISMTPTransport
501 typedef struct tagSMTPMESSAGE2
508 } SMTPMESSAGE2, *LPSMTPMESSAGE2;
512 HRESULT ResetWindow();
514 HRESULT SendMessage2(
515 [in] LPSMTPMESSAGE2 pMessage);
517 HRESULT CommandRCPT2(
518 [in] LPSTR pszEmailTo,
519 [in] INETADDRTYPE atDSN);
522 /* FIXME: IDAVNamespaceArbiter, IPropPatchRequest, IPropFindRequest, IPropFindMultiResponse, IPropFindResponse, IHTTPMailCallback, IHTTPMailTransport */
526 uuid(0DF2C7E3-3435-11D0-81D0-00C04FD85AB4),
529 interface IPOP3Callback : ITransportCallback
531 typedef enum tagPOP3COMMAND
551 typedef struct tagPOP3RETR
559 } POP3RETR, *LPPOP3RETR;
561 typedef struct tagPOP3TOP
570 } POP3TOP, *LPPOP3TOP;
572 typedef struct tagPOP3LIST
576 } POP3LIST, *LPPOP3LIST;
578 typedef struct tagPOP3UIDL
582 } POP3UIDL, *LPPOP3UIDL;
584 typedef struct tagPOP3STAT
588 } POP3STAT, *LPPOP3STAT;
590 typedef struct tagPOP3RESPONSE
594 IXPRESULT rIxpResult;
595 IPOP3Transport *pTransport;
597 [switch_type(POP3COMMAND), switch_is(command)]
600 [case(POP3_UIDL)] POP3UIDL rUidlInfo;
601 [case(POP3_STAT)] POP3STAT rStatInfo;
602 [case(POP3_LIST)] POP3LIST rListInfo;
603 [case(POP3_DELE)] DWORD dwPopId;
604 [case(POP3_RETR)] POP3RETR rRetrInfo;
605 [case(POP3_TOP)] POP3TOP rTopInfo;
608 } POP3RESPONSE, *LPPOP3RESPONSE;
611 [in] LPPOP3RESPONSE pResponse);
616 uuid(0DF2C7E4-3435-11D0-81D0-00C04FD85AB4),
619 interface IPOP3Transport : IInternetTransport
621 typedef enum tagPOP3CMDTYPE
628 typedef enum tagPOP3MARKTYPE
630 POP3_MARK_FOR_TOP = 0x01,
631 POP3_MARK_FOR_RETR = 0x02,
632 POP3_MARK_FOR_DELE = 0x04,
633 POP3_MARK_FOR_UIDL = 0x08,
634 POP3_MARK_FOR_LIST = 0x10
638 [in] LPSTR pszLogFilePath,
639 [in] IPOP3Callback *pCallback);
642 [in] POP3MARKTYPE marktype,
644 [in] boolean fMarked);
647 [in] LPSTR pszAuthType);
650 [in] LPSTR pszUserName);
653 [in] LPSTR pszPassword);
656 [in] POP3CMDTYPE cmdtype,
660 [in] POP3CMDTYPE cmdtype,
662 [in] DWORD cPreviewLines);
664 HRESULT CommandQUIT();
666 HRESULT CommandSTAT();
668 HRESULT CommandNOOP();
670 HRESULT CommandRSET();
673 [in] POP3CMDTYPE cmdtype,
677 [in] POP3CMDTYPE cmdtype,
681 [in] POP3CMDTYPE cmdtype,
685 /* FIXME: INNTPCallback, INNTPTransport */
687 /* FIXME: IRangeList */
689 /* FIXME: IIMAPCallback, IIMAPTransport */
692 cpp_quote("HRESULT WINAPI CreateRASTransport(IRASTransport **ppTransport);")
693 cpp_quote("HRESULT WINAPI CreateNNTPTransport(INNTPTransport **ppTransport);")
694 cpp_quote("HRESULT WINAPI CreateIMAPTransport(IIMAPTransport **ppTransport);")
695 cpp_quote("HRESULT WINAPI CreateIMAPTransport2(IIMAPTransport2 **ppTransport);")
696 cpp_quote("HRESULT WINAPI CreateRangeList(IRangeList **ppRangeList);")
698 cpp_quote("HRESULT WINAPI CreateSMTPTransport(ISMTPTransport **ppTransport);")
699 cpp_quote("HRESULT WINAPI CreatePOP3Transport(IPOP3Transport **ppTransport);")