1        ConeĀ©
2
3MAIL::MIMESTRUCT(3x)    Cone: COnsole Newsreader And E    MAIL::MIMESTRUCT(3x)
4
5
6

NAME

8       mail::mimestruct - Message MIME structure
9

SYNOPSIS

11       #include <libmail/structure.H>
12
13       mail::mimestruct myMimeStructure;
14

USAGE

16       mail::mimestruct describes the contents of a MIME-formatted message. A
17       multipart MIME message has a single mail::mimestruct object that
18       represents the entire message, and series of mail::mimestruct objects,
19       one object for each part of the multipart MIME section. The additional
20       mail::mimestruct objects are maintained by their parent
21       mail::mimestruct object, and are automatically destroyed when the
22       parent object is destroyed.
23
24       A mail::mimestruct contains the following fields:
25
26       std::string mime_id
27           An opaque identifier of this MIME section. Applications should
28           handle this field as an opaque text string, which is interpreted by
29           LibMAIL . A same message, for example, may have different mime_id
30           fields if it comes from an IMAP account, or a POP3 account.
31
32           The only exception to this rule is that the mail::mimestruct object
33           that represents the entire message will have an empty string in
34           mime_id.
35
36       std::string type
37           The major MIME type, in uppercase.
38
39       std::string subtype
40           The minor MIME subtype, in uppercase.
41
42       mail::mimestruct::parameterList type_parameters
43           Additional attributes parsed from the Content-Type: MIME header.
44           See below for more information.
45
46       std::string content_id
47           The contents of the MIME Content-ID: header.
48
49       std::string content_description
50           The contents of the MIME Content-Description: header.
51
52       std::string content_transfer_encoding
53           The MIME encoding method.
54
55       std::string content_md5
56           The contents of the MIME Content-MD5: header.
57
58       std::string content_language
59           The contents of the MIME Content-Language: header.
60
61       std::string content_disposition
62           The MIME Content-Disposition: header, either "INLINE", or
63           "ATTACHMENT" (or blank, if the header is not present).
64
65       size_t content_size
66           The approximate size of the MIME section, in bytes (for
67           non-multipart MIME sections only).
68
69       size_t content_lines
70           Approximate number of lines in a TEXT MIME section.
71
72       mail::mimestruct::parameterList content_disposition_parameters
73           Additional attributes parsed from the Content-Disposition: MIME
74           header. See below for more information.
75
76   mail::mimestruct methods
77       bool flag=messagerfc822();
78           Returns true if type is "MESSAGE" and subtype is "RFC822".
79
80       bool flag=messagerfc822()
81           Returns true if type is "MESSAGE" and subtype is "RFC822".
82
83       mail::envelope &myEnvelope=getEnvelope()
84           Returns a mail::envelope object, if messagerfc822 returns true.
85
86       size_t numChildren=getNumChildren()
87           Returns the number of MIME sections in a multipart MIME message.
88
89       mail::mimestruct *child=getChild(size_t childNum)
90           Returns a pointer to a mail::mimestruct object that represents a
91           single part of a multipart MIME message.  childNum must be between
92           zero and one less than the number of parts returned by
93           getNumChildren.
94
95       mail::mimestruct *parent=getParent()
96           Returns a pointer to a mail::mimestruct object that represents the
97           parent of this MIME part, if this mail::mimestruct object
98           represents a single part of a multipart MIME message. Returns NULL
99           if this mail::mimestruct object represents the entire MIME message.
100
101           Note
102           mail::mimestruct objects that represent MESSAGE/RFC822 content
103           should have getNumChildren return 1, and getChild with childNum set
104           to 0 should return a pointer to a mail::mimestruct object that
105           represents the MESSAGE/RFC822 message. However, getNumChildren may
106           return 0 if the MIME message is corrupted.
107

MAIL::MIMESTRUCT::PARAMETERLIST

109       A mail::mimestruct::parameterList object holds parsed MIME attributes
110       in the Content-Type: and Content-Disposition: headers. A
111       mail::mimestruct::parameterList object has the following methods:
112
113       bool flag=exists(std::string name);
114           This method returns true if the attribute name exists.
115
116       std::string str=get(std::string name, std::string charset);
117           Returns the value of attribute name (uppercase). If info is not
118           NULL, the attribute's value is converted to the specified character
119           set (if the attribute uses RFC 2231[1] to specify its character set
120           and language).
121
122       void set(std::string name, std::string value, std::string charset,
123       std::string language);
124           Set the attribute name to value. If charset and/or language are not
125           empty strings, name's character set and language are indicated
126           accordingly, as per RFC 2231[1].
127
128       mail::mimestruct::parameterList::iterator begin(), end();
129       mail::mimestruct::parameterList::const_iterator begin() const, end()
130       const;
131           The begin and end functions return the equivalent iterators over
132           the individual name/value MIME attributes. The iterators point to a
133           std::pair<std::string, std::string>; first is the attribute name
134           (uppercased), and second is its value. (The underlying structure
135           being iterated is a std::map<std::string, std::string>.)
136

SEE ALSO

138       mail::envelope(3x), mail::account::readMessageAttributes(3x).
139

AUTHOR

141       Sam Varshavchik
142

NOTES

144        1. RFC 2231
145           http://www.rfc-editor.org/rfc/rfc2231.txt
146
147
148
149ConeĀ©                             08/25/2016              MAIL::MIMESTRUCT(3x)
Impressum