00001
00005 #ifndef __MAIL_H
00006 #define __MAIL_H
00007
00008 #include "INet.h"
00009 #include "Base64.h"
00010 #include "Progress.h"
00011 #include "GVariant.h"
00012
00013 #ifndef GPL_COMPATIBLE
00014 #define GPL_COMPATIBLE 0
00015 #endif
00016
00017
00018 #define MAX_LINE_SIZE 1024
00019 #define MAX_NAME_SIZE 64
00020 #define EMAIL_LINE_SIZE 76
00021
00022
00023
00024
00025 #define CONTENT_NONE 0
00026 #define CONTENT_BASE64 1
00027 #define CONTENT_QUOTED_PRINTABLE 2
00028 #define CONTENT_OCTET_STREAM 3
00029
00030
00031 #define MAIL_SEND_COLOUR Rgb24(0, 0, 0xff)
00032 #define MAIL_RECEIVE_COLOUR Rgb24(0, 0x8f, 0)
00033 #define MAIL_ERROR_COLOUR Rgb24(0xff, 0, 0)
00034 #define MAIL_WARNING_COLOUR Rgb24(0xff, 0x7f, 0)
00035 #define MAIL_INFO_COLOUR Rgb24(0, 0, 0)
00036
00037
00038 extern void TokeniseStrList(char *Str, List<char> &Output, const char *Delim);
00039 extern char ConvHexToBin(char c);
00040 #define ConvBinToHex(i) (((i)<10)?'0'+(i):'A'+(i)-10)
00041 extern void DecodeAddrName(char *Start, GAutoString &Name, GAutoString &Addr, char *DefaultDomain);
00042 extern bool IsValidEmail(char *email, GAutoString *out = 0);
00043 extern char *DecodeRfc2047(char *Str);
00044 extern char *EncodeRfc2047(char *Str, const char *CodePage, List<char> *CharsetPrefs, int LineLength = 0);
00045 extern char *DecodeBase64Str(char *Str, int Len = -1);
00046 extern char *DecodeQuotedPrintableStr(char *Str, int Len = -1);
00047 extern bool Is8Bit(char *Text);
00048 extern int MaxLineLen(char *Text);
00049 extern char *EncodeImapString(char *s);
00050 extern char *DecodeImapString(char *s);
00051
00052
00053 class MailProtocol;
00054
00055 struct MailProtocolError
00056 {
00057 int Code;
00058 char *Msg;
00059
00060 MailProtocolError()
00061 {
00062 Code = 0;
00063 Msg = 0;
00064 }
00065
00066 ~MailProtocolError()
00067 {
00068 DeleteArray(Msg);
00069 }
00070 };
00071
00072 class MailProtocolProgress
00073 {
00074 public:
00075 int Start;
00076 int Value;
00077 int Range;
00078
00079 MailProtocolProgress()
00080 {
00081 Empty();
00082 }
00083
00084 void Empty()
00085 {
00086 Start = 0;
00087 Value = 0;
00088 Range = 0;
00089 }
00090 };
00091
00092 class LogEntry
00093 {
00094 public:
00095 char *Text;
00096 COLOUR c;
00097
00098 LogEntry(char *t, int len, COLOUR col)
00099 {
00100 c = col;
00101 Text = 0;
00102
00103 if (t)
00104 {
00105 char *n = strnchr(t, '\r', len);
00106 if (n)
00107 {
00108 Text = NewStr(t, n-t);
00109 }
00110 else
00111 {
00112 Text = NewStr(t, len);
00113 }
00114 }
00115 }
00116
00117 ~LogEntry()
00118 {
00119 DeleteArray(Text);
00120 }
00121 };
00122
00124 class FileDescriptor : public GBase
00125 {
00126 protected:
00127
00128 int64 Size;
00129 char *MimeType;
00130 char *ContentId;
00131
00132
00133 GFile File;
00134 GStreamI *Embeded;
00135 bool OwnEmbeded;
00136 int64 Offset;
00137 GSemaphore *Lock;
00138
00139
00140 uchar *Data;
00141 GAutoPtr<GStream> DataStream;
00142
00143 public:
00144 FileDescriptor(GStreamI *embed, int64 Offset, int64 Size, char *Name);
00145 FileDescriptor(char *name);
00146 FileDescriptor(char *data, int64 len);
00147 FileDescriptor();
00148 ~FileDescriptor();
00149
00150 void SetLock(GSemaphore *l);
00151 GSemaphore *GetLock();
00152 void SetOwnEmbeded(bool i);
00153
00154
00155 GStreamI *GotoObject();
00156 uchar *GetData();
00157 int Sizeof();
00158 char *GetMimeType() { return MimeType; }
00159 void SetMimeType(char *s) { DeleteArray(MimeType); MimeType = NewStr(s); }
00160 char *GetContentId() { return ContentId; }
00161 void SetContentId(char *s) { DeleteArray(ContentId); ContentId = NewStr(s); }
00162
00163
00164 bool Decode(char *ContentType,
00165 char *ContentTransferEncoding,
00166 char *MimeData,
00167 int MimeDataLength);
00168 };
00169
00170 #define MAIL_ADDR_TO 0
00171 #define MAIL_ADDR_CC 1
00172 #define MAIL_ADDR_BCC 2
00173 #define MAIL_ADDR_FROM 3
00174
00176 class AddressDescriptor : public GBase
00177 {
00178 public:
00179 uint8 Status;
00180 uchar CC;
00181 char *Name;
00182 char *Addr;
00183
00184 void *Data;
00185
00186 AddressDescriptor(AddressDescriptor *Copy = 0);
00187 ~AddressDescriptor();
00188 void _Delete();
00189
00190 void Print(char *Str);
00191 int Sizeof()
00192 {
00193 return SizeofStr(Name) +
00194 SizeofStr(Addr);
00195 }
00196
00197 bool Serialize(GFile &f, bool Write)
00198 {
00199 bool Status = true;
00200 if (Write)
00201 {
00202 WriteStr(f, Name);
00203 WriteStr(f, Addr);
00204 }
00205 else
00206 {
00207 DeleteArray(Name);
00208 Name = ReadStr(f PassDebugArgs);
00209 DeleteArray(Addr);
00210 Addr = ReadStr(f PassDebugArgs);
00211 }
00212 return Status;
00213 }
00214 };
00215
00216
00217
00218
00219
00220 #define MAIL_PRIORITY_HIGH 1
00221 #define MAIL_PRIORITY_NORMAL 3 // ???
00222 #define MAIL_PRIORITY_LOW 5
00223
00224 class MailMessage
00225 {
00226 char* Text;
00227 char* TextCharset;
00228
00229 char* Html;
00230 char* HtmlCharset;
00231
00232 public:
00233 List<AddressDescriptor> To;
00234 AddressDescriptor *From;
00235 AddressDescriptor *Reply;
00236 GAutoString Subject;
00237 GAutoString MessageID;
00238 GAutoString FwdMsgId;
00239 GAutoString BounceMsgId;
00240 List<FileDescriptor> FileDesc;
00241 char* InternetHeader;
00242 char Priority;
00243 int MarkColour;
00244 uint8 DispositionNotificationTo;
00245 GAutoString References;
00246
00247
00248 void *Private;
00249
00250
00251 MailMessage();
00252 virtual ~MailMessage();
00253 void Empty();
00254
00255 virtual char *GetBody();
00256 virtual bool SetBody(const char *Txt, int Bytes = -1, bool Copy = true, const char *Cs = 0);
00257 virtual char *GetBodyCharset();
00258 virtual bool SetBodyCharset(const char *Cs);
00259
00260 virtual char *GetHtml();
00261 virtual bool SetHtml(const char *Txt, int Bytes = -1, bool Copy = true, const char *Cs = 0);
00262 virtual char *GetHtmlCharset();
00263 virtual bool SetHtmlCharset(const char *Cs);
00264
00265
00266 GStringPipe *Raw;
00267
00268
00269 bool Encode (GStreamI &Out, GStream *HeadersSink, MailProtocol *Protocol, bool Mime = true);
00270 bool EncodeHeaders (GStreamI &Out, MailProtocol *Protocol, bool Mime = true);
00271 bool EncodeBody (GStreamI &Out, MailProtocol *Protocol, bool Mime = true);
00272
00273
00274 int EncodeText (GStreamI &Out, GStreamI &In);
00275 int EncodeQuotedPrintable (GStreamI &Out, GStreamI &In);
00276 int EncodeBase64 (GStreamI &Out, GStreamI &In);
00277 };
00278
00280 class MailProtocol
00281 {
00282 protected:
00283 char Buffer[4<<10];
00284 GSemaphore SocketLock;
00285 GAutoPtr<GSocketI> Socket;
00286
00287 bool Error(const char *file, int line, const char *msg, ...);
00288 bool Read();
00289 bool Write(char *Buf = NULL, bool Log = false);
00290
00291 virtual void OnUserMessage(char *Str) {}
00292
00293 public:
00294
00295 GStreamI *Logger;
00296 void Log(const char *Str, COLOUR c);
00297
00298
00299 MailProtocolProgress *Items;
00300 MailProtocolProgress *Transfer;
00301
00302
00303 GAutoString ServerMsg;
00304 char *ProgramName;
00305 char *DefaultDomain;
00306 char *ExtraOutgoingHeaders;
00307 List<char> CharsetPrefs;
00308
00309
00310 MailProtocol();
00311 virtual ~MailProtocol();
00312
00313
00314
00315
00317 bool CloseSocket()
00318 {
00319 GSemaphore::Auto l(&SocketLock, _FL);
00320
00321 if (Socket)
00322 return Socket->Close();
00323
00324 return false;
00325 }
00326
00327 };
00328
00330
00331
00333 #define MAIL_USE_STARTTLS 0x01
00335 #define MAIL_USE_AUTH 0x02
00337 #define MAIL_USE_PLAIN 0x04
00339 #define MAIL_USE_LOGIN 0x08
00341 #define MAIL_USE_NTLM 0x10
00343 #define MAIL_SECURE_AUTH 0x20
00345 #define MAIL_SSL 0x40
00346
00348 class MailSink : public MailProtocol
00349 {
00350 public:
00352 virtual bool Open
00353 (
00355 GSocketI *S,
00357 const char *RemoteHost,
00359 const char *LocalDomain,
00361 const char *UserName,
00363 const char *Password,
00365 int Port,
00367 int Flags
00368 ) = 0;
00370 virtual bool Close() = 0;
00371
00372
00373
00376 virtual GStringPipe *SendStart(List<AddressDescriptor> &To, AddressDescriptor *From, MailProtocolError *Err = 0) = 0;
00377
00379 virtual bool SendEnd(GStringPipe *Sink) = 0;
00380
00381
00382 virtual bool Send(MailMessage *Msg, bool Mime) { return false; }
00383 };
00384
00385 struct ImapMailFlags
00386 {
00387 uint8 ImapAnswered : 1;
00388 uint8 ImapDeleted : 1;
00389 uint8 ImapDraft : 1;
00390 uint8 ImapFlagged : 1;
00391 uint8 ImapRecent : 1;
00392 uint8 ImapSeen : 1;
00393 uint8 ImapExpunged :1;
00394
00395 ImapMailFlags(char *init = 0)
00396 {
00397 ImapAnswered = 0;
00398 ImapDeleted = 0;
00399 ImapDraft = 0;
00400 ImapFlagged = 0;
00401 ImapRecent = 0;
00402 ImapSeen = 0;
00403 ImapExpunged = 0;
00404
00405 if (init)
00406 Set(init);
00407 }
00408
00409 char *Get()
00410 {
00411 char s[256] = "", *c = s;
00412
00413 if (ImapAnswered) c += sprintf(c, "\\answered ");
00414 if (ImapDeleted) c += sprintf(c, "\\deleted ");
00415 if (ImapDraft) c += sprintf(c, "\\draft ");
00416 if (ImapFlagged) c += sprintf(c, "\\flagged ");
00417 if (ImapRecent) c += sprintf(c, "\\recent ");
00418 if (ImapSeen) c += sprintf(c, "\\seen ");
00419
00420 if (c == s)
00421 return 0;
00422
00423 LgiAssert(c < s + sizeof(s));
00424 c--;
00425 *c = 0;
00426 return NewStr(s);
00427 }
00428
00429 void Set(const char *s)
00430 {
00431 ImapAnswered = false;
00432 ImapDeleted = false;
00433 ImapDraft = false;
00434 ImapFlagged = false;
00435 ImapRecent = false;
00436 ImapSeen = false;
00437 ImapExpunged = false;
00438
00439 if (!s) s = "";
00440 while (*s)
00441 {
00442 if (*s == '/' || *s == '\\')
00443 {
00444 while (*s == '/' || *s == '\\')
00445 s++;
00446 const char *e = s;
00447 while (*e && isalpha(*e))
00448 e++;
00449
00450 if (!strnicmp(s, "answered", e-s))
00451 ImapAnswered = true;
00452 else if (!strnicmp(s, "deleted", e-s))
00453 ImapDeleted = true;
00454 else if (!strnicmp(s, "draft", e-s))
00455 ImapDraft = true;
00456 else if (!strnicmp(s, "flagged", e-s))
00457 ImapFlagged = true;
00458 else if (!strnicmp(s, "recent", e-s))
00459 ImapRecent = true;
00460 else if (!strnicmp(s, "seen", e-s))
00461 ImapSeen = true;
00462
00463 s = e;
00464 }
00465 else s++;
00466 }
00467 }
00468
00469 bool operator ==(ImapMailFlags &f)
00470 {
00471 return ImapAnswered == f.ImapAnswered &&
00472 ImapDeleted == f.ImapDeleted &&
00473 ImapDraft == f.ImapDraft &&
00474 ImapFlagged == f.ImapFlagged &&
00475 ImapRecent == f.ImapRecent &&
00476 ImapSeen == f.ImapSeen &&
00477 ImapExpunged == f.ImapExpunged;
00478 }
00479
00480 bool operator !=(ImapMailFlags &f)
00481 {
00482 return !(ImapAnswered == f.ImapAnswered &&
00483 ImapDeleted == f.ImapDeleted &&
00484 ImapDraft == f.ImapDraft &&
00485 ImapFlagged == f.ImapFlagged &&
00486 ImapRecent == f.ImapRecent &&
00487 ImapSeen == f.ImapSeen &&
00488 ImapExpunged == f.ImapExpunged);
00489 }
00490 };
00491
00493 class MailTransaction
00494 {
00495 public:
00497 int Index;
00498
00500 int Flags;
00501
00502
00503 bool Status;
00504 bool Oversize;
00505
00507 GStreamI *Stream;
00508
00510 ImapMailFlags Imap;
00511
00513 void *UserData;
00514
00515 MailTransaction();
00516 ~MailTransaction();
00517 };
00518
00520 enum MailSrcStatus
00521 {
00523 DownloadAll,
00525 DownloadTop,
00527 DownloadNone,
00529 DownloadAbort
00530 };
00531
00533 typedef MailSrcStatus (*MailSrcCallback)
00534 (
00536 MailTransaction *Trans,
00538 int64 Size,
00540 int *LinesToDownload,
00542 void *Data
00543 );
00544
00546 typedef bool (*MailReceivedCallback)
00547 (
00549 MailTransaction *Trans,
00551 void *Data
00552 );
00553
00558 struct MailCallbacks
00559 {
00561 void *CallbackData;
00563 MailSrcCallback OnSrc;
00565 MailReceivedCallback OnReceive;
00566 };
00567
00569 #define MAIL_SOURCE_STARTTLS 0x01
00571 #define MAIL_SOURCE_AUTH 0x02
00573 #define MAIL_SOURCE_USE_PLAIN 0x04
00575 #define MAIL_SOURCE_USE_LOGIN 0x08
00576
00578 class MailSource : public MailProtocol
00579 {
00580 public:
00582 virtual bool Open
00583 (
00585 GSocketI *S,
00587 char *RemoteHost,
00589 int Port,
00591 char *User,
00593 char *Password,
00595 char *&Cookie,
00597 int Flags = 0) = 0;
00599 virtual bool Close() = 0;
00600
00602 virtual int GetMessages() = 0;
00604 virtual bool Receive
00605 (
00608 GArray<MailTransaction*> &Trans,
00610 MailCallbacks *Callbacks = 0
00611 ) = 0;
00613 virtual bool Delete(int Message) = 0;
00615 virtual int Sizeof(int Message) = 0;
00617 virtual bool GetSizes(GArray<int> &Sizes) { return false; }
00619 virtual bool GetUid(int Message, char *Id) = 0;
00621 virtual bool GetUidList(List<char> &Id) = 0;
00623 virtual char *GetHeaders(int Message) = 0;
00625 virtual void SetProxy(char *Server, int Port) {}
00626 };
00627
00629
00630
00632 class MailSmtp : public MailSink
00633 {
00634 protected:
00635 bool ReadReply(const char *Str, GStringPipe *Pipe = 0, MailProtocolError *Err = 0);
00636 bool WriteText(const char *Str);
00637
00638 public:
00639 MailSmtp();
00640 ~MailSmtp();
00641
00642 bool Open(GSocketI *S, const char *RemoteHost, const char *LocalDomain, const char *UserName, const char *Password, int Port = SMTP_PORT, int Flags = 0);
00643 bool Close();
00644
00645 bool SendToFrom(List<AddressDescriptor> &To, AddressDescriptor *From, MailProtocolError *Err = 0);
00646 GStringPipe *SendData(MailProtocolError *Err = 0);
00647
00648 GStringPipe *SendStart(List<AddressDescriptor> &To, AddressDescriptor *From, MailProtocolError *Err = 0);
00649 bool SendEnd(GStringPipe *Sink);
00650
00651 bool Send(MailMessage *Msg, bool Mime = false);
00652 };
00653
00654 class MailSendFolder : public MailSink
00655 {
00656 class MailPostFolderPrivate *d;
00657
00658 public:
00659 MailSendFolder(char *Path);
00660 ~MailSendFolder();
00661
00662 bool Open(GSocketI *S, const char *RemoteHost, const char *LocalDomain, const char *UserName, const char *Password, int Port = 0, int Flags = 0);
00663 bool Close();
00664
00665 GStringPipe *SendStart(List<AddressDescriptor> &To, AddressDescriptor *From, MailProtocolError *Err = 0);
00666 bool SendEnd(GStringPipe *Sink);
00667 };
00668
00669 class MailPop3 : public MailSource
00670 {
00671 protected:
00672 bool ReadReply();
00673 bool ReadMultiLineReply(char *&Str);
00674 int GetInt();
00675 bool MailIsEnd(char *Ptr, int Len);
00676 bool ListCmd(char *Cmd, GHashTable &Results);
00677
00678 char *End;
00679 char *Marker;
00680 int Messages;
00681
00682 public:
00683 MailPop3();
00684 ~MailPop3();
00685
00686
00687 bool Open(GSocketI *S, char *RemoteHost, int Port, char *User, char *Password, char *&Cookie, int Flags = 0);
00688 bool Close();
00689
00690
00691 int GetMessages();
00692 bool Receive(GArray<MailTransaction*> &Trans, MailCallbacks *Callbacks = 0);
00693 bool Delete(int Message);
00694 int Sizeof(int Message);
00695 bool GetSizes(GArray<int> &Sizes);
00696 bool GetUid(int Message, char *Id);
00697 bool GetUidList(List<char> &Id);
00698 char *GetHeaders(int Message);
00699 };
00700
00701 class MailReceiveFolder : public MailSource
00702 {
00703 protected:
00704 class MailReceiveFolderPrivate *d;
00705
00706 public:
00707 MailReceiveFolder(char *Path);
00708 ~MailReceiveFolder();
00709
00710
00711 bool Open(GSocketI *S, char *RemoteHost, int Port, char *User, char *Password, char *&Cookie, int Flags = 0);
00712 bool Close();
00713
00714
00715 int GetMessages();
00716 bool Receive(GArray<MailTransaction*> &Trans, MailCallbacks *Callbacks = 0);
00717 bool Delete(int Message);
00718 int Sizeof(int Message);
00719 bool GetUid(int Message, char *Id);
00720 bool GetUidList(List<char> &Id);
00721 char *GetHeaders(int Message);
00722 };
00723
00724 class MailPhp : public MailSource
00725 {
00726 protected:
00727 class MailPhpPrivate *d;
00728
00729 bool Get(GSocketI *S, char *Uri, GStream &Out, bool ChopDot);
00730
00731 public:
00732 MailPhp();
00733 ~MailPhp();
00734
00735
00736 bool Open(GSocketI *S, char *RemoteHost, int Port, char *User, char *Password, char *&Cookie, int Flags = 0);
00737 bool Close();
00738
00739
00740 int GetMessages();
00741 bool Receive(GArray<MailTransaction*> &Trans, MailCallbacks *Callbacks = 0);
00742 bool Delete(int Message);
00743 int Sizeof(int Message);
00744 bool GetSizes(GArray<int> &Sizes);
00745 bool GetUid(int Message, char *Id);
00746 bool GetUidList(List<char> &Id);
00747 char *GetHeaders(int Message);
00748 void SetProxy(char *Server, int Port);
00749 };
00750
00751 class MailImapFolder
00752 {
00753 friend class MailIMap;
00754 friend class ImapThreadPrivate;
00755
00756 char Sep;
00757 char *Path;
00758
00759 public:
00760 bool NoSelect;
00761 bool NoInferiors;
00762 bool Marked;
00763 int Exists;
00764 int Recent;
00765 int Deleted;
00766
00767
00768 MailImapFolder();
00769 virtual ~MailImapFolder();
00770
00771 char *GetPath();
00772 void SetPath(char *s);
00773 char *GetName();
00774 void SetName(char *s);
00775 void operator =(GHashTbl<char*,int> &v);
00776 };
00777
00778 class MailIMap : public MailSource, public GSemaphore
00779 {
00780 protected:
00781 class MailIMapPrivate *d;
00782
00783 char Buf[1024];
00784 List<char> Uid;
00785 GStringPipe ReadBuf;
00786 List<char> Dialog;
00787
00788 void ClearDialog();
00789 void ClearUid();
00790 bool FillUidList();
00791 bool WriteBuf(bool ObsurePass = false, const char *Buffer = 0);
00792 bool ReadResponse(int Cmd = -1, GStringPipe *Out = 0, bool Plus = false);
00793 bool Read(GStreamI *Out = 0);
00794 bool ReadLine();
00795
00796 public:
00797
00798 struct Untagged
00799 {
00800 GAutoString Cmd;
00801 GAutoString Param;
00802 int Id;
00803 };
00804
00805 typedef bool (*FetchCallback)(class MailIMap *Imap, char *Msg, GHashTbl<char*, char*> &Parts, void *UserData);
00806
00807
00808 MailIMap();
00809 ~MailIMap();
00810
00811
00812 char GetFolderSep();
00813 char *EncodePath(char *Path);
00814 char *GetCurrentPath();
00815 bool GetExpungeOnExit();
00816 void SetExpungeOnExit(bool b);
00817 bool ServerOption(char *Opt);
00818 bool IsOnline();
00819
00820
00821 bool Open(GSocketI *S, char *RemoteHost, int Port, char *User, char *Password, char *&Cookie, int Flags = 0);
00822 bool Close();
00823 bool GetCapabilities(GArray<char*> &s);
00824
00825
00826 bool Receive(GArray<MailTransaction*> &Trans, MailCallbacks *Callbacks = 0);
00827 bool GetParts(int Message, GStreamI &Out, char *Parts, char **Flags = 0);
00828 int GetMessages();
00829 bool Delete(int Message);
00830 int Sizeof(int Message);
00831 bool GetUid(int Message, char *Id);
00832 bool GetUidList(List<char> &Id);
00833 char *GetHeaders(int Message);
00834 char *SequenceToString(GArray<int> *Seq);
00835
00836
00837
00839 bool Fetch
00840 (
00842 bool ByUid,
00844 char *Seq,
00846 char *Parts,
00848 FetchCallback Callback,
00850 void *UserData,
00852 GStreamI *RawCopy = 0
00853 );
00854
00856 bool Append
00857 (
00859 char *Folder,
00861 ImapMailFlags *Flags,
00863 char *Msg,
00865 GAutoString &NewUid
00866 );
00867
00868 bool GetFolders(List<MailImapFolder> &Folders);
00869 bool SelectFolder(char *Path, GHashTbl<char*,int> *Values = 0);
00870 char *GetSelectedFolder();
00871 int GetMessages(char *Path);
00872 bool CreateFolder(MailImapFolder *f);
00873 bool DeleteFolder(char *Path);
00874 bool RenameFolder(char *From, char *To);
00875 bool SetFolderFlags(MailImapFolder *f);
00876
00878 bool ExpungeFolder();
00879
00880
00881 bool CopyByUid(GArray<char*> &InUids, char *DestFolder);
00882 bool SetFlagsByUid(GArray<char*> &Uids, char *Flags);
00883
00886 bool StartIdle();
00887 bool OnIdle(int Timeout, GArray<Untagged> &Resp);
00888 bool FinishIdle();
00889 bool Poll(int *Recent = 0, GArray<GAutoString> *New = 0);
00890 bool Status(char *Path, int *Recent);
00891 bool Search(bool Uids, GArray<GAutoString> &SeqNumbers, char *Filter);
00892
00893
00894 static bool Http(GSocketI *S,
00895 GAutoString *OutHeaders,
00896 GAutoString *OutBody,
00897 int *StatusCode,
00898 char *InMethod,
00899 char *InUri,
00900 char *InHeaders,
00901 char *InBody);
00902 };
00903
00904 #endif