1 Cone©
2
3MAIL::ACCOUNT::GETME(3x)Cone: COnsole Newsreader And EMAIL::ACCOUNT::GETME(3x)
4
5
6
8 mail::ACCOUNT::getMessageContent - Read message content
9
11 #include <libmail/sync.H>
12
13
14 class myStoreCallback : public mail::ACCOUNT::Store {
15
16 public:
17 void search(size_t messageNumber, std::string messageContents);
18 };
19
20 myStoreCallback storeCallback;
21
22 mail::ACCOUNT *mail;
23
24 bool ok=mail->getMessageContent(const std::vector<size_t> &msgList,
25 bool peek, mail::readMode requestType,
26 storeCallback);
27
28 bool ok=mail->getMessageContent(size_t messageNum, bool peek,
29 const mail::mimestruct &messagePart,
30 mail::readMode requestType,
31 storeCallback);
32
33 std::string errmsg=mail->getErrmsg();
34
36 mail::ACCOUNT::getMessagesContent reads messages in the currently open
37 folder. There are two alternative versions of this method.
38
39 · The first version receives a list of message numbers. This version
40 is capable of returning headers and/or content of multiple
41 messages.
42
43 msgList specifies a list of messages. Messages are numbered
44 starting with message #0 and up to one less than
45 mail::ACCOUNT::getFolderIndexSize(3x) (when
46 mail::account::getFolderIndexSize returns 6, the messages are
47 numbered 0 through 5). Only the messages that appear in msgList are
48 processed by this request. When a message is removed from the
49 folder, by mail::ACCOUNT::updateFolderIndexInfo(3x), the following
50 messages are renumbered accordingly.
51
52 Note
53 Most mail servers allow multiple applications to open the same
54 folder. Therefore, changes to the folder's contents can occur
55 at any time. Before making this request, the application should
56 use mail::ACCOUNT::checkNewMail(3x) to verify that no
57 unexpected changes have been made to the folder's contents.
58
59 · The second version receives a single message number, and a
60 mail::mimestruct object that refers to a single MIME attachment or
61 a section of this message. The mail::mimestruct object was
62 previously obtained from mail::ACCOUNT::getMessageStructure(3x),
63 for this message. This method returns a recursive tree of
64 mail::mimestruct objects which enumerates the individual MIME
65 sections in the message. messagePart must be a reference to one of
66 these objects (or to a copy of these objects).
67
68 Setting peek to true does not reset the unread message status flag for
69 this message. Otherwise the unread message status flag will be reset.
70
71 storeCallback's store method receives the requested content, which is
72 determined by the remaining parameters.
73
74 requestType identifies the type of information to return from the
75 selected MIME section, and must be set to one of the following values:
76
77 mail::readHeadersFolded
78 Return only the headers of the MIME section. Folded headers are
79 unfolded (the newline and the leading space on the next line are
80 replaced with a single space character).
81
82 mail::readHeaders
83 Return only the headers of the MIME section. The headers are
84 returned as-is, without unfolding them.
85
86 mail::readContents
87 Return the content of the MIME section.
88
89 Note
90 The MIME section is not decoded. Check the
91 Content-Transfer-Encoding header to know what you're getting.
92
93 mail::readBoth
94 Return the entire MIME section, as is: its headers, a blank line,
95 then the contents.
96
97 The callback method may not receive the entire requested content at
98 once. Typically the method will be invoked multiple times; each time
99 the method receives the next portion of the requested content. When
100 requesting headers and/or content of multiple messages, they may be
101 returned in any order, and the messageNumber parameter indicates which
102 message's contents are being returned (note, however, that the entire
103 contents of a given message are returned in their entirety, even when
104 the callback method gets invoked multiple times for that message,
105 before content from the next message are returned).
106
108 This method returns true if it succeeds, or false if it fails. If the
109 method fails, use mail::ACCOUNT::getErrmsg() to read a brief
110 description of the error.
111
113 mail::ACCOUNT::getMessageContentDecoded(3x),
114 mail::ACCOUNT::getMessageEnvelope(3x),
115 mail::ACCOUNT::getMessageStructure(3x).
116
118 Sam Varshavchik
119
120
121
122Cone© 08/25/2016 MAIL::ACCOUNT::GETME(3x)