📄 mail.h
字号:
/* Primary body types *//* If you change any of these you must also change body_types in rfc822.c */#define TYPETEXT 0 /* unformatted text */#define TYPEMULTIPART 1 /* multiple part */#define TYPEMESSAGE 2 /* encapsulated message */#define TYPEAPPLICATION 3 /* application data */#define TYPEAUDIO 4 /* audio */#define TYPEIMAGE 5 /* static image */#define TYPEVIDEO 6 /* video */#define TYPEMODEL 7 /* model */#define TYPEOTHER 8 /* unknown */#define TYPEMAX 15 /* maximum type code *//* Body encodings *//* If you change any of these you must also change body_encodings in rfc822.c */#define ENC7BIT 0 /* 7 bit SMTP semantic data */#define ENC8BIT 1 /* 8 bit SMTP semantic data */#define ENCBINARY 2 /* 8 bit binary data */#define ENCBASE64 3 /* base-64 encoded data */#define ENCQUOTEDPRINTABLE 4 /* human-readable 8-as-7 bit data */#define ENCOTHER 5 /* unknown */#define ENCMAX 10 /* maximum encoding code *//* Body contents */#define BODY struct mail_bodystruct#define MESSAGE struct mail_body_message#define PARAMETER struct mail_body_parameter#define PART struct mail_body_part#define PARTTEXT struct mail_body_text/* Message body text */PARTTEXT { unsigned long offset; /* offset from body origin */ SIZEDTEXT text; /* text */};/* Message body structure */BODY { unsigned short type; /* body primary type */ unsigned short encoding; /* body transfer encoding */ char *subtype; /* subtype string */ PARAMETER *parameter; /* parameter list */ char *id; /* body identifier */ char *description; /* body description */ struct { /* body disposition */ char *type; /* disposition type */ PARAMETER *parameter; /* disposition parameters */ } disposition; STRINGLIST *language; /* body language */ char *location; /* body content URI */ PARTTEXT mime; /* MIME header */ PARTTEXT contents; /* body part contents */ union { /* different ways of accessing contents */ PART *part; /* body part list */ MESSAGE *msg; /* body encapsulated message */ } nested; struct { unsigned long lines; /* size of text in lines */ unsigned long bytes; /* size of text in octets */ } size; char *md5; /* MD5 checksum */ void *sparep; /* spare pointer reserved for main program */};/* Parameter list */PARAMETER { char *attribute; /* parameter attribute name */ char *value; /* parameter value */ PARAMETER *next; /* next parameter in list */};/* Multipart content list */PART { BODY body; /* body information for this part */ PART *next; /* next body part */};/* RFC-822 Message */MESSAGE { ENVELOPE *env; /* message envelope */ BODY *body; /* message body */ PARTTEXT full; /* full message */ STRINGLIST *lines; /* lines used to filter header */ PARTTEXT header; /* header text */ PARTTEXT text; /* body text */};/* Entry in the message cache array */typedef struct message_cache { unsigned long msgno; /* message number */ unsigned int lockcount : 8; /* non-zero if multiple references */ unsigned long rfc822_size; /* # of bytes of message as raw RFC822 */ struct { /* c-client internal use only */ unsigned long uid; /* message unique ID */ unsigned long mod; /* modseq */ PARTTEXT special; /* special text pointers */ MESSAGE msg; /* internal message pointers */ union { /* driver internal use */ unsigned long data; void *ptr; } spare; unsigned int sequence : 1; /* saved sequence bit */ unsigned int dirty : 1; /* driver internal use */ unsigned int filter : 1; /* driver internal use */ unsigned int ghost : 1; /* driver internal use */ } private; /* internal date */ unsigned int day : 5; /* day of month (1-31) */ unsigned int month : 4; /* month of year (1-12) */ unsigned int year : 7; /* year since BASEYEAR (expires in 127 yrs) */ unsigned int hours: 5; /* hours (0-23) */ unsigned int minutes: 6; /* minutes (0-59) */ unsigned int seconds: 6; /* seconds (0-59) */ unsigned int zoccident : 1; /* non-zero if west of UTC */ unsigned int zhours : 4; /* hours from UTC (0-12) */ unsigned int zminutes: 6; /* minutes (0-59) */ /* system flags */ unsigned int seen : 1; /* system Seen flag */ unsigned int deleted : 1; /* system Deleted flag */ unsigned int flagged : 1; /* system Flagged flag */ unsigned int answered : 1; /* system Answered flag */ unsigned int draft : 1; /* system Draft flag */ unsigned int recent : 1; /* system Recent flag */ /* message status */ unsigned int valid : 1; /* elt has valid flags */ unsigned int searched : 1; /* message was searched */ unsigned int sequence : 1; /* message is in sequence */ /* reserved for use by main program */ unsigned int spare : 1; /* first spare bit */ unsigned int spare2 : 1; /* second spare bit */ unsigned int spare3 : 1; /* third spare bit */ unsigned int spare4 : 1; /* fourth spare bit */ unsigned int spare5 : 1; /* fifth spare bit */ unsigned int spare6 : 1; /* sixth spare bit */ unsigned int spare7 : 1; /* seventh spare bit */ unsigned int spare8 : 1; /* eighth spare bit */ void *sparep; /* spare pointer */ unsigned long user_flags; /* user-assignable flags */} MESSAGECACHE;/* String structure */#define STRINGDRIVER struct string_drivertypedef struct mailstring { void *data; /* driver-dependent data */ unsigned long data1; /* driver-dependent data */ unsigned long size; /* total length of string */ char *chunk; /* base address of chunk */ unsigned long chunksize; /* size of chunk */ unsigned long offset; /* offset of this chunk in base */ char *curpos; /* current position in chunk */ unsigned long cursize; /* number of bytes remaining in chunk */ STRINGDRIVER *dtb; /* driver that handles this type of string */} STRING;/* Dispatch table for string driver */STRINGDRIVER { /* initialize string driver */ void (*init) (STRING *s,void *data,unsigned long size); /* get next character in string */ char (*next) (STRING *s); /* set position in string */ void (*setpos) (STRING *s,unsigned long i);};/* Stringstruct access routines */#define INIT(s,d,data,size) ((*((s)->dtb = &d)->init) (s,data,size))#define SIZE(s) ((s)->size - GETPOS (s))#define CHR(s) (*(s)->curpos)#define SNX(s) (--(s)->cursize ? *(s)->curpos++ : (*(s)->dtb->next) (s))#define GETPOS(s) ((s)->offset + ((s)->curpos - (s)->chunk))#define SETPOS(s,i) (*(s)->dtb->setpos) (s,i)/* Search program */#define SEARCHPGM struct search_program#define SEARCHHEADER struct search_header#define SEARCHSET struct search_set#define SEARCHOR struct search_or#define SEARCHPGMLIST struct search_pgm_listSEARCHHEADER { /* header search */ SIZEDTEXT line; /* header line */ SIZEDTEXT text; /* text in header */ SEARCHHEADER *next; /* next in list */};SEARCHSET { /* message set */ unsigned long first; /* sequence number */ unsigned long last; /* last value, if a range */ SEARCHSET *next; /* next in list */};SEARCHOR { SEARCHPGM *first; /* first program */ SEARCHPGM *second; /* second program */ SEARCHOR *next; /* next in list */};SEARCHPGMLIST { SEARCHPGM *pgm; /* search program */ SEARCHPGMLIST *next; /* next in list */};SEARCHPGM { /* search program */ SEARCHSET *msgno; /* message numbers */ SEARCHSET *uid; /* unique identifiers */ SEARCHOR *or; /* or'ed in programs */ SEARCHPGMLIST *not; /* and'ed not program */ SEARCHHEADER *header; /* list of headers */ STRINGLIST *bcc; /* bcc recipients */ STRINGLIST *body; /* text in message body */ STRINGLIST *cc; /* cc recipients */ STRINGLIST *from; /* originator */ STRINGLIST *keyword; /* keywords */ 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 long older; /* older than this interval */ unsigned long younger; /* younger than this interval */ 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 */ unsigned int dirty : 1; /* has data not written to backup */ 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; /* extracted subject string */ char *message_id; /* message-id string */ char *unique; /* unique string, normally message-id */ 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 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -