|
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Internet SMTP Transport Driver - forward declarations for utility functions |
|
15 // "Assert" errors codes returned by IMSM.DLL |
|
16 // |
|
17 // |
|
18 |
|
19 #if !defined (__IMSMSUTIL_H) |
|
20 #define __IMSMSUTIL_H |
|
21 |
|
22 enum TSmtsAssertError |
|
23 { |
|
24 EImsmSmtpFileObjectAlreadyExists = 0, // Tried to create another CImSmtpFile object when one existed already |
|
25 EImsmZeroRecipientsInMessage = 1, // Message header contains zero To, Cc or Bcc addresses |
|
26 EImsmNoFromAddress = 2, // No From() address in header |
|
27 EImsmNoFileStore = 3, // iFileStore is not open |
|
28 EImsmBodyTextNotHandledHere = 4, // Bug in code: should never be called if state is ESendData |
|
29 EImsmBadSmtpBuffer = 5, // IMSK buffer is null, or full or has overflowed |
|
30 EImsmBadSessionState = 6, // iState variable out of range in iSmtpSession object |
|
31 EImsmBadFileState = 7, // iState variable out of range in iSmtpFile object |
|
32 EImsmNoCrLfTerminator = 8, // "\r\n" character pair not found at end of SmtpBuffer |
|
33 EImsmBadBodyEncodingState = 9, // illegal value for CImSendConvert()'s encoding parameter |
|
34 EImsmEmptyEmailAddress = 10, // zero-length descriptor has been passed as the email address |
|
35 EImsmEmptyPostOffice = 11, // zero-length descriptor has been passed as the SMTP post office name |
|
36 EImsmEmptyRespath = 12, // zero-length descriptor has been passed as the resource path |
|
37 EImsmNoServiceInfo = 13, // service info was missing |
|
38 EImsmServerError = 14, // error occured locking/releasing entries |
|
39 |
|
40 ESmtsBusy = 15, // second request has been issued to Smts before first one has completed |
|
41 EEntryNotSet = 16, |
|
42 EImsmEntryIsNotaServer = 17, |
|
43 |
|
44 EImsmUnexpectedSmtpPositiveError = 18, |
|
45 EImsmUnableToSetServerEntryBack = 19, |
|
46 EImsmUnableToSetServerEntryToMessage = 20, |
|
47 |
|
48 EImsmBadSmtpAuthProfile1 = 21, |
|
49 EImsmBadSmtpAuthProfile2 = 22, |
|
50 EImsmSmtpAuthLoginBadState = 23, |
|
51 EImsmSmtpAuthHelperAlreadyExists = 24, |
|
52 |
|
53 EImsmSocketAlreadyConnected = 25, |
|
54 EImsmSocketNotConnected1 = 26, |
|
55 EImsmSocketNotConnected2 = 27, |
|
56 |
|
57 EImsmSessionManagerInvalidState = 28, |
|
58 |
|
59 EImsmUnexpectedState1 = 29, |
|
60 EImsmUnexpectedState2 = 30, |
|
61 EImsmUnexpectedState3 = 31, |
|
62 EImsmUnexpectedState4 = 32, |
|
63 EImsmUnexpectedState5 = 33, |
|
64 EImsmUnexpectedState6 = 34, |
|
65 EImsmSessionNotDefined = 35, |
|
66 EImsmUnexpectedMobilityAction = 36 |
|
67 }; |
|
68 |
|
69 |
|
70 // SMTP session and file error codes... |
|
71 enum TSmtpSessionError |
|
72 { |
|
73 ESmtpServiceNotAvailable=421, // SMTP error code 421 |
|
74 ESmtpMailboxUnavailable=450, // SMTP error code 450 |
|
75 ESmtpActionAborted=451, // SMTP error code 451 |
|
76 ESmtpActionNotTaken=452, // SMTP error code 452 |
|
77 ESmtpTempAuthenticationFailure=454, // SMTP error code 454 |
|
78 ESmtpCommandUnrecognised=500, // SMTP error code 500 |
|
79 ESmtpSyntaxError=501, // SMTP error code 501 |
|
80 ESmtpCommmandNotImplemented=502, // SMTP error code 502 |
|
81 ESmtpBadSequence=503, // SMTP error code 503 |
|
82 ESmtpParamNotImplemented=504, // SMTP error code 504 |
|
83 ESmtpAuthenticationRequired=530, // SMTP error code 530 |
|
84 ESmtpAuthenticationFailed=535, // SMTP error code 535 |
|
85 ESmtpMailboxNoAccess=550, // SMTP error code 550 |
|
86 ESmtpUserNotLocal=551, // SMTP error code 551 |
|
87 ESmtpExceededStorage=552, // SMTP error code 552 |
|
88 ESmtpMailboxName=553, // SMTP error code 553 |
|
89 ESmtpTransactionFailed=554, // SMTP error code 554 |
|
90 ESmtpNoReturnCode=599, // Fake SMTP error code - probably not talking to SMTP server at all! |
|
91 }; |
|
92 |
|
93 |
|
94 GLREF_C void RequestComplete(TRequestStatus& aStatus,TInt aCompletion); |
|
95 GLREF_C TBool LastSmtpCommandAccepted(TInt SmtpCode,TInt aRequiredFirstDigit); |
|
96 |
|
97 GLREF_C TInt SmtpResponseCode(const TDesC8& aTextLine,TBool& aMultiLineResponse,TBool& aLastMultiLineResponse); |
|
98 GLREF_C TInt IdentifySmtpError(TInt aSmtpErrorCode); |
|
99 |
|
100 |
|
101 GLREF_C void gPanic(TSmtsAssertError); |
|
102 |
|
103 // string constants used whilst parsing response from SMTP server |
|
104 _LIT8(KEsmtpMatchString,"*ESMTP *"); |
|
105 _LIT8(K8BitMimeMatchString,"*8-BITMIME *"); |
|
106 _LIT8(KSizeMatchString,"*SIZE *"); |
|
107 _LIT8(KStartTlsMatchString,"*STARTTLS*"); |
|
108 _LIT8(KAuthMatchString,"*AUTH *"); |
|
109 _LIT8(KAuthPlainMatchString,"* PLAIN*"); |
|
110 _LIT8(KAuthLoginMatchString,"* LOGIN*"); |
|
111 _LIT8(KAuthCramMD5MatchString,"* CRAM-MD5*"); |
|
112 |
|
113 // Special case for non-compliant Domino servers |
|
114 _LIT8(KAuthDominoMatchString,"*AUTH=*"); |
|
115 _LIT8(KAuthDominoPlainMatchString,"*=PLAIN*"); |
|
116 _LIT8(KAuthDominoLoginMatchString,"*=LOGIN*"); |
|
117 _LIT8(KAuthDominoCramMD5MatchString,"*=CRAM-MD5*"); |
|
118 |
|
119 //string constants containing SMTP command words |
|
120 _LIT8(KSmtpHeloCommand,"HELO [%S]\r\n"); |
|
121 _LIT8(KSmtpEhloCommand,"EHLO [%S]\r\n"); |
|
122 _LIT8(KSmtpStartTlsCommand,"STARTTLS\r\n"); |
|
123 _LIT8(KSmtpTlsResponse,"220"); |
|
124 _LIT8(KSmtpResetCommand,"RSET\r\n"); |
|
125 |
|
126 _LIT8(KSmtpMailFromCommand,"MAIL FROM:<"); |
|
127 _LIT8(KSmtpRcptToCommand,"RCPT TO:<"); |
|
128 _LIT8(KSmtpDataCommand,"DATA\r\n"); |
|
129 _LIT8(KSmtpEndOfDataCommand,".\r\n"); |
|
130 _LIT8(KSmtpNoopCommand,"NOOP\r\n"); |
|
131 _LIT8(KSmtpQuitCommand,"QUIT\r\n"); |
|
132 _LIT8(KSmtpCloseAngleBracket,">\r\n"); |
|
133 _LIT8(KSmtpCrLf,"\r\n"); |
|
134 |
|
135 //string constants containing SMTP AUTH command words |
|
136 _LIT8(KSmtpAuthCommand, "AUTH "); |
|
137 |
|
138 #ifdef _UNICODE |
|
139 _LIT(KSmtpEmailAddressAndAliasFmtStr,"\"%S\" <%S>"); |
|
140 #else |
|
141 _LIT8(KSmtpEmailAddressAndAliasFmtStr,"\"%S\" <%S>"); |
|
142 #endif |
|
143 |
|
144 // general purpose strings |
|
145 _LIT8(KStuffDot,"."); |
|
146 _LIT8(KSmtpMatchCrLf,"*\r\n"); // used to detect CRLF terminator in outgoing buffer (only used in debug build) |
|
147 |
|
148 #endif |