who can tell me the specific structure figure of
struct rfc2045 compares to a real raw mail,especially include image/gif.
 
 specific struct rfc2045 and raw mail are below:
I want to know which part is firstpart ,how is parts are devided!
 
just like:
RAW MAIL:
Received: (qmail 12264 invoked from network); 9 Jun 2001 11:14:55 -0000
          for <[EMAIL PROTECTED]>; 9 Jun 2001 11:14:55 -0000
Message-ID: <009901c0f0d5$429b2ce0$520a0a0a@wucheng>
From: "wucheng" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject:
Date: Sat, 9 Jun 2001 19:13:49 +0800
MIME-Version: 1.0
        type="multipart/alternative"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
 
This is a multi-part message in MIME format.
 
------=_NextPart_000_0095_01C0F118.509B5480
Received: (qmail 12264 invoked from network); 9 Jun 2001 11:14:55 -0000
Received: from unknown (HELO wucheng) ([10.10.10.82]) (envelope-sender <wucheng@
mailsrv.sigurd.com.cn>)
------=_NextPart_000_0095_01C0F118.509B5480
Received: (qmail 12264 invoked from network); 9 Jun 2001 11:14:55 -0000
Received: from unknown (HELO wucheng) ([10.10.10.82]) (envelope-sender <wucheng@
mailsrv.sigurd.com.cn>)
          by mailsrv.sigurd.com.cn (qmail-ldap-1.03) with SMTP
          for <[EMAIL PROTECTED]>; 9 Jun 2001 11:14:55 -0000
Message-ID: <009901c0f0d5$429b2ce0$520a0a0a@wucheng>
From: "wucheng" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject:
Date: Sat, 9 Jun 2001 19:13:49 +0800
MIME-Version: 1.0
        type="multipart/alternative"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
 
This is a multi-part message in MIME format.
 
------=_NextPart_000_0095_01C0F118.509B5480
Content-Type: multipart/alternative;
        boundary="----=_NextPart_001_0096_01C0F118.509B5480"

------=_NextPart_001_0096_01C0F118.509B5480
Content-Type: text/plain;
        charset="gb2312"
Content-Transfer-Encoding: base64
 
DQogDQrKorTztcTN7bvhDQrH68T6ss680w0KIA0KDQoNCg0KDQoNCsjVxtqjug0KDQoNCsqxvOSj
ug0KDQoNCrXYteOjug0K
 
------=_NextPart_001_0096_01C0F118.509B5480
Content-Type: text/html;
        charset="gb2312"
Content-Transfer-Encoding: base64
 
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv
L0VOIj4NCjxIVE1MPjxIRUFEPjxUSVRMRT48L1RJVExFPg0KPE1FVEEgY29udGVudD0idGV4dC9o
dG1sOyBjaGFyc2V0PWdiMjMxMiIgaHR0cC1lcXVpdj1Db250ZW50LVR5cGU+PEJBU0UgDQpocmVm
PC9CT0RZPjwvSFRNTD4NCg==
 
------=_NextPart_001_0096_01C0F118.509B5480--
 
------=_NextPart_000_0095_01C0F118.509B5480
Content-Type: image/gif;
        name="=?gb2312?B?0ru49sLMyavG+MfyLkdJRg==?="
Content-Transfer-Encoding: base64
"Content-ID": <009301c0f0d5$4271fa00$520a0a0a@wucheng>
 
R0lGODlhXACkANX/AP///zExMWNjY8DAwM6cnJxjY/+cnGMxMc5jY/9jY84xMWMAAP8AAM4xAM5j
Mc6cY//OAM7OnJycY2NjMc7OMZzOMc7/nGOcMWPOMZzOnGOcYzFjMQBjAACcMWP/nDGcY5z/zgBj
MWPOnACcYzHOnM7//5zOzmOcnJz//zFjY2POzmP//wAxMQCcnABjnAAxYzFjnGNjnDExYwAAMWMx
zmMxnM6czpxjnGMxY85jzpwAnM4xnGMAMf9jnM4xYwAAACH5BAEAAAMALAAAAABcAKQAQAb/wIFw
SCwaj8ikcnnM9ZjQqHRKrVqvEYngJBBoBAXvRTDeXF6p1AatiVzfzMjnQtLUT6mW5kP6nDR6JCd3
...........
 
 
struct rfc2045:
 
struct rfc2045 {
 struct rfc2045 *parent;
 unsigned pindex;
 struct rfc2045 *next;
 
 off_t startpos, /* At which offset in msg this section starts */
  endpos,  /* Where it ends */
  startbody, /* Where the body of the msg starts */
  endbody; /* endpos - trailing CRLF terminator */
 off_t nlines;  /* Number of lines in message */
 off_t nbodylines; /* Number of lines only in the body */
 char *mime_version;
 char *content_type;
 struct rfc2045attr *content_type_attr; /* Content-Type: attributes */
 
 char *content_disposition;
 char *boundary;
 struct rfc2045attr *content_disposition_attr;
 char *content_transfer_encoding;
 int content_8bit;  /*
     ** Set if content_transfer_encoding is
     ** 8bit
     */
 char *content_id;
 char *content_description;
 char *content_language;
 char *content_md5;
 char *content_base;
 char *content_location;
 struct  rfc2045ac *rfc2045acptr;
 int has8bitchars; /* For rewriting */
 int haslongline; /* For rewriting */
 unsigned rfcviolation; /* Boo-boos */
 
#define RFC2045_ERR8BITHEADER 1 /* 8 bit characters in headers */
#define RFC2045_ERR8BITCONTENT 2 /* 8 bit contents, but no 8bit
     content-transfer-encoding */
#define RFC2045_ERR2COMPLEX 4 /* Too many nested contents */
 
 unsigned numparts; /* # of parts allocated */
 
 char *rw_transfer_encoding; /* For rewriting */
 
#define RFC2045_RW_7BIT 1
#define RFC2045_RW_8BIT 2
 
 /* Subsections */
 
 struct rfc2045 *firstpart, *lastpart;
 
 /* Working area */
 
 char *workbuf;
 size_t workbufsize;
 size_t workbuflen;
 int workinheader;
 int workclosed;
 int isdummy;
 int informdata; /* In a middle of a long form-data part */
 char *header;
 size_t headersize;
 size_t headerlen;
 
 int (*decode_func)(struct rfc2045 *, const char *, size_t);
 void *misc_decode_ptr;
 int (*udecode_func)(const char *, size_t, void *);
} ;
 

Reply via email to