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