📄 mail.h
字号:
STRINGLIST *unkeyword; /* unkeywords */ STRINGLIST *subject; /* text in subject */ STRINGLIST *text; /* text in headers and body */ STRINGLIST *to; /* to recipients */ unsigned long larger; /* larger than this size */ unsigned long smaller; /* smaller than this size */ unsigned short sentbefore; /* sent before this date */ unsigned short senton; /* sent on this date */ unsigned short sentsince; /* sent since this date */ unsigned short before; /* before this date */ unsigned short on; /* on this date */ unsigned short since; /* since this date */ unsigned int answered : 1; /* answered messages */ unsigned int unanswered : 1; /* unanswered messages */ unsigned int deleted : 1; /* deleted messages */ unsigned int undeleted : 1; /* undeleted messages */ unsigned int draft : 1; /* message draft */ unsigned int undraft : 1; /* message undraft */ unsigned int flagged : 1; /* flagged messages */ unsigned int unflagged : 1; /* unflagged messages */ unsigned int recent : 1; /* recent messages */ unsigned int old : 1; /* old messages */ unsigned int seen : 1; /* seen messages */ unsigned int unseen : 1; /* unseen messages */ /* These must be simulated in IMAP */ STRINGLIST *return_path; /* error return address */ STRINGLIST *sender; /* sender address list */ STRINGLIST *reply_to; /* reply address list */ STRINGLIST *in_reply_to; /* replied message ID */ STRINGLIST *message_id; /* message ID */ STRINGLIST *newsgroups; /* USENET newsgroups */ STRINGLIST *followup_to; /* USENET reply newsgroups */ STRINGLIST *references; /* USENET references */};/* Mailbox status */typedef struct mbx_status { long flags; /* validity flags */ unsigned long messages; /* number of messages */ unsigned long recent; /* number of recent messages */ unsigned long unseen; /* number of unseen messages */ unsigned long uidnext; /* next UID to be assigned */ unsigned long uidvalidity; /* UID validity value */} MAILSTATUS;/* Sort program */typedef void (*postsort_t) (void *sc);#define SORTPGM struct sort_programSORTPGM { unsigned int reverse : 1; /* sort function is to be reversed */ unsigned int abort : 1; /* abort sorting */ short function; /* sort function */ unsigned long nmsgs; /* number of messages being sorted */ struct { unsigned long cached; /* number of messages cached so far */ unsigned long sorted; /* number of messages sorted so far */ unsigned long postsorted; /* number of postsorted messages so far */ } progress; postsort_t postsort; /* post sorter */ SORTPGM *next; /* next function */};/* Sort cache */#define SORTCACHE struct sort_cacheSORTCACHE { unsigned int sorted : 1; /* message has been sorted */ unsigned int postsorted : 1; /* message has been postsorted */ unsigned int refwd : 1; /* subject is a re or fwd */ SORTPGM *pgm; /* sort program */ unsigned long num; /* message number (sequence or UID) */ unsigned long date; /* sent date */ unsigned long arrival; /* arrival date */ unsigned long size; /* message size */ char *from; /* from string */ char *to; /* to string */ char *cc; /* cc string */ char *subject; /* subject string */ char *message_id; /* message-id string */ STRINGLIST *references; /* references string */};/* ACL list */#define ACLLIST struct acl_listACLLIST { char *identifier; /* authentication identifier */ char *rights; /* access rights */ ACLLIST *next;};/* Quota resource list */#define QUOTALIST struct quota_listQUOTALIST { char *name; /* resource name */ unsigned long usage; /* resource usage */ unsigned long limit; /* resource limit */ QUOTALIST *next; /* next resource */};/* Mail Access I/O stream *//* Structure for mail driver dispatch */#define DRIVER struct driver /* Mail I/O stream */ typedef struct mail_stream { DRIVER *dtb; /* dispatch table for this driver */ void *local; /* pointer to driver local data */ char *mailbox; /* mailbox name */ unsigned short use; /* stream use count */ unsigned short sequence; /* stream sequence */ unsigned int inbox : 1; /* stream open on an INBOX */ unsigned int lock : 1; /* stream lock flag */ unsigned int debug : 1; /* stream debug flag */ unsigned int silent : 1; /* don't pass events to main program */ unsigned int rdonly : 1; /* stream read-only flag */ unsigned int anonymous : 1; /* stream anonymous access flag */ unsigned int scache : 1; /* stream short cache flag */ unsigned int halfopen : 1; /* stream half-open flag */ unsigned int secure : 1; /* stream secure flag */ unsigned int tryalt : 1; /* stream tryalt flag */ unsigned int mulnewsrc : 1; /* stream use multiple newsrc files */ unsigned int perm_seen : 1; /* permanent Seen flag */ unsigned int perm_deleted : 1;/* permanent Deleted flag */ unsigned int perm_flagged : 1;/* permanent Flagged flag */ unsigned int perm_answered :1;/* permanent Answered flag */ unsigned int perm_draft : 1; /* permanent Draft flag */ unsigned int kwd_create : 1; /* can create new keywords */ unsigned int uid_nosticky : 1;/* UIDs are not preserved */ unsigned long perm_user_flags;/* mask of permanent user flags */ unsigned long gensym; /* generated tag */ unsigned long nmsgs; /* # of associated msgs */ unsigned long recent; /* # of recent msgs */ unsigned long uid_validity; /* UID validity sequence */ unsigned long uid_last; /* last assigned UID */ char *user_flags[NUSERFLAGS]; /* pointers to user flags in bit order */ unsigned long cachesize; /* size of message cache */ MESSAGECACHE **cache; /* message cache array */ SORTCACHE **sc; /* sort cache array */ unsigned long msgno; /* message number of `current' message */ ENVELOPE *env; /* scratch buffer for envelope */ BODY *body; /* scratch buffer for body */ SIZEDTEXT text; /* scratch buffer for text */ union { /* internal use only */ struct { /* search temporaries */ STRINGLIST *string; /* string(s) to search */ long result; /* search result */ char *text; /* cache of fetched text */ } search; } private;} MAILSTREAM;/* Mail I/O stream handle */typedef struct mail_stream_handle { MAILSTREAM *stream; /* pointer to mail stream */ unsigned short sequence; /* sequence of what we expect stream to be */} MAILHANDLE;/* Message overview */typedef struct mail_overview { char *subject; /* message subject string */ ADDRESS *from; /* originator address list */ char *date; /* message composition date string */ char *message_id; /* message ID */ char *references; /* USENET references */ struct { /* may be 0 or NUL if unknown/undefined */ unsigned long octets; /* message octets (probably LF-newline form) */ unsigned long lines; /* message lines */ char *xref; /* cross references */ } optional;} OVERVIEW;/* Network access I/O stream *//* Structure for network driver dispatch */#define NETDRIVER struct net_driver/* Network transport I/O stream */typedef struct net_stream { void *stream; /* driver's I/O stream */ NETDRIVER *dtb; /* network driver */} NETSTREAM;/* Network transport driver dispatch */NETDRIVER { void *(*open) (char *host,char *service,unsigned long port); void *(*aopen) (NETMBX *mb,char *service,char *usrbuf); char *(*getline) (void *stream); long (*getbuffer) (void *stream,unsigned long size,char *buffer); long (*soutr) (void *stream,char *string); long (*sout) (void *stream,char *string,unsigned long size); void (*close) (void *stream); char *(*host) (void *stream); char *(*remotehost) (void *stream); unsigned long (*port) (void *stream); char *(*localhost) (void *stream);};/* Mailgets data identifier */typedef struct GETS_DATA { MAILSTREAM *stream; unsigned long msgno; char *what; STRINGLIST *stl; unsigned long first; unsigned long last; long flags;} GETS_DATA;#define INIT_GETS(md,s,m,w,f,l) \ md.stream = s, md.msgno = m, md.what = w, md.first = f, md.last = l, \ md.stl = NIL, md.flags = NIL;/* Mail delivery I/O stream */typedef struct send_stream { NETSTREAM *netstream; /* network I/O stream */ char *reply; /* last reply string */ long replycode; /* last reply code */ unsigned int debug : 1; /* stream debug flag */ union { /* protocol specific */ struct { /* SMTP specific */ unsigned int ok : 1; /* supports ESMTP */ struct { /* service extensions */ unsigned int send : 1; /* supports SEND */ unsigned int soml : 1; /* supports SOML */ unsigned int saml : 1; /* supports SAML */ unsigned int expn : 1; /* supports EXPN */ unsigned int help : 1; /* supports HELP */ unsigned int turn : 1; /* supports TURN */ unsigned int etrn : 1; /* supports ETRN */ unsigned int relay : 1; /* supports relaying */ unsigned int pipe : 1; /* supports pipelining */ unsigned int ensc : 1; /* supports enhanced status codes */ } service; struct { /* 8-bit MIME transport */ unsigned int ok : 1; /* supports 8-bit MIME */ unsigned int want : 1; /* want 8-bit MIME */ } eightbit; struct { /* delivery status notification */ unsigned int ok : 1; /* supports DSN */ unsigned int want : 1; /* want DSN */ struct { /* notification options */ /* notify on failure */ unsigned int failure : 1; /* notify on delay */ unsigned int delay : 1; /* notify on success */ unsigned int success : 1; } notify; unsigned int full : 1; /* return full headers */ } dsn; struct { /* size declaration */ unsigned int ok : 1; /* supports SIZE */ unsigned long limit; /* maximum size supported */ } size; unsigned long auth; /* supported SASL authenticators */ } esmtp; struct { /* NNTP specific */ unsigned int post : 1; /* supports POST */ } nntp; } protocol;} SENDSTREAM;/* Jacket into external interfaces */typedef long (*readfn_t) (void *stream,unsigned long size,char *buffer);typedef char *(*mailgets_t) (readfn_t f,void *stream,unsigned long size, GETS_DATA *md);typedef char *(*readprogress_t) (GETS_DATA *md,unsigned long octets);typedef void *(*mailcache_t) (MAILSTREAM *stream,unsigned long msgno,long op);typedef long (*mailproxycopy_t) (MAILSTREAM *stream,char *sequence, char *mailbox,long options);typedef long (*tcptimeout_t) (long overall,long last);typedef void *(*authchallenge_t) (void *stream,unsigned long *len);typedef long (*authrespond_t) (void *stream,char *s,unsigned long size);typedef long (*authcheck_t) (void);typedef long (*authclient_t) (authchallenge_t challenger, authrespond_t responder,NETMBX *mb,void *s, unsigned long *trial,char *user);typedef char *(*authresponse_t) (void *challenge,unsigned long clen, unsigned long *rlen);typedef char *(*authserver_t) (authresponse_t responder,int argc,char *argv[]);typedef void (*smtpverbose_t) (char *buffer);typedef void (*imapenvelope_t) (MAILSTREAM *stream,unsigned long msgno, ENVELOPE *env);typedef char *(*imapreferral_t) (MAILSTREAM *stream,char *url,long code);typedef void (*overview_t) (MAILSTREAM *stream,unsigned long uid,OVERVIEW *ov);typedef unsigned long *(*sorter_t) (MAILSTREAM *stream,char *charset, SEARCHPGM *spg,SORTPGM *pgm,long flags);typedef void (*parseline_t) (ENVELOPE *env,char *hdr,char *data,char *host);typedef ADDRESS *(*parsephrase_t) (char *phrase,char *end,char *host);typedef void *(*blocknotify_t) (int reason,void *data);typedef void (*getacl_t) (MAILSTREAM *stream,char *mailbox,ACLLIST *acl);typedef void (*listrights_t) (MAILSTREAM *stream,char *mailbox,char *id, char *alwaysrights,STRINGLIST *possiblerights);typedef void (*myrights_t) (MAILSTREAM *stream,char *mailbox,char *rights);typedef void (*quota_t) (MAILSTREAM *stream,char *qroot,QUOTALIST *qlist);typedef void (*quotaroot_t) (MAILSTREAM *stream,char *mbx,STRINGLIST *qroot);typedef void (*sortresults_t) (MAILSTREAM *stream,unsigned long *list, unsigned long size);typedef char *(*newsrcquery_t) (MAILSTREAM *stream,char *mulname,char *name);typedef char *(*userprompt_t) (void);typedef long (*append_t) (MAILSTREAM *stream,void *data,char **flags, char **date,STRING **message);typedef void (*freeenvelopesparep_t) (void **sparep);typedef void (*freeeltsparep_t) (void **sparep);/* Globals */extern char *body_types[]; /* defined body type strings */extern char *body_encodings[]; /* defined body encoding strings */extern const char *days[]; /* day name strings */extern const char *months[]; /* month name strings *//* Threading *//* Thread node */#define THREADNODE struct thread_nodeTHREADNODE { unsigned long num; /* message number */ SORTCACHE *sc; /* (internal use) sortcache entry */ THREADNODE *branch; /* branch at this point in tree */ THREADNODE *next; /* next node */};typedef void (*threadresults_t) (MAILSTREAM *stream,THREADNODE *tree);/* Thread dispatch */#define THREADER struct threader_listTHREADER { char *name; /* name of threader */ THREADNODE *(*dispatch) (MAILSTREAM *stream,char *charset,SEARCHPGM *spg, long flags,sorter_t sorter); THREADER *next;};/* Container for references threading */typedef void ** container_t;/* Namespaces */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -