|
a/src/internfile/mh_mail.cpp |
|
b/src/internfile/mh_mail.cpp |
|
... |
|
... |
50 |
static const string cstr_content = "content";
|
50 |
static const string cstr_content = "content";
|
51 |
static const string cstr_author = "author";
|
51 |
static const string cstr_author = "author";
|
52 |
static const string cstr_recipient = "recipient";
|
52 |
static const string cstr_recipient = "recipient";
|
53 |
static const string cstr_modificationdate = "modificationdate";
|
53 |
static const string cstr_modificationdate = "modificationdate";
|
54 |
static const string cstr_title = "title";
|
54 |
static const string cstr_title = "title";
|
|
|
55 |
static const string cstr_msgid = "msgid";
|
|
|
56 |
static const string cstr_abstract = "abstract";
|
55 |
|
57 |
|
56 |
MimeHandlerMail::~MimeHandlerMail()
|
58 |
MimeHandlerMail::~MimeHandlerMail()
|
57 |
{
|
59 |
{
|
58 |
clear();
|
60 |
clear();
|
59 |
}
|
61 |
}
|
|
... |
|
... |
163 |
if (m_idx == -1) {
|
165 |
if (m_idx == -1) {
|
164 |
m_metaData[cstr_mimetype] = "text/plain";
|
166 |
m_metaData[cstr_mimetype] = "text/plain";
|
165 |
res = processMsg(m_bincdoc, 0);
|
167 |
res = processMsg(m_bincdoc, 0);
|
166 |
LOGDEB1(("MimeHandlerMail::next_document: mimetype %s\n",
|
168 |
LOGDEB1(("MimeHandlerMail::next_document: mimetype %s\n",
|
167 |
m_metaData[cstr_mimetype].c_str()));
|
169 |
m_metaData[cstr_mimetype].c_str()));
|
|
|
170 |
const string& txt = m_metaData[cstr_content];
|
|
|
171 |
if (m_startoftext < txt.size())
|
|
|
172 |
m_metaData[cstr_abstract] = txt.substr(m_startoftext, 250);
|
168 |
} else {
|
173 |
} else {
|
|
|
174 |
m_metaData[cstr_abstract] = "";
|
169 |
res = processAttach();
|
175 |
res = processAttach();
|
170 |
}
|
176 |
}
|
171 |
m_idx++;
|
177 |
m_idx++;
|
172 |
m_havedoc = m_idx < (int)m_attachments.size();
|
178 |
m_havedoc = m_idx < (int)m_attachments.size();
|
173 |
return res;
|
179 |
return res;
|
|
... |
|
... |
311 |
text += string("Cc: ") + transcoded + string("\n");
|
317 |
text += string("Cc: ") + transcoded + string("\n");
|
312 |
if (depth == 1) {
|
318 |
if (depth == 1) {
|
313 |
m_metaData[cstr_recipient] += " " + transcoded;
|
319 |
m_metaData[cstr_recipient] += " " + transcoded;
|
314 |
}
|
320 |
}
|
315 |
}
|
321 |
}
|
|
|
322 |
if (doc->h.getFirstHeader("Message-Id", hi)) {
|
|
|
323 |
if (depth == 1) {
|
|
|
324 |
m_metaData[cstr_msgid] = hi.getValue();
|
|
|
325 |
trimstring(m_metaData[cstr_msgid], "<>");
|
|
|
326 |
}
|
|
|
327 |
}
|
316 |
if (doc->h.getFirstHeader("Date", hi)) {
|
328 |
if (doc->h.getFirstHeader("Date", hi)) {
|
317 |
rfc2047_decode(hi.getValue(), transcoded);
|
329 |
rfc2047_decode(hi.getValue(), transcoded);
|
318 |
if (depth == 1) {
|
330 |
if (depth == 1) {
|
319 |
time_t t = rfc2822DateToUxTime(transcoded);
|
331 |
time_t t = rfc2822DateToUxTime(transcoded);
|
320 |
if (t != (time_t)-1) {
|
332 |
if (t != (time_t)-1) {
|
|
... |
|
... |
335 |
m_subject = transcoded;
|
347 |
m_subject = transcoded;
|
336 |
}
|
348 |
}
|
337 |
text += string("Subject: ") + transcoded + string("\n");
|
349 |
text += string("Subject: ") + transcoded + string("\n");
|
338 |
}
|
350 |
}
|
339 |
text += '\n';
|
351 |
text += '\n';
|
340 |
|
352 |
m_startoftext = text.size();
|
341 |
LOGDEB2(("MimeHandlerMail::processMsg:ismultipart %d mime subtype '%s'\n",
|
353 |
LOGDEB2(("MimeHandlerMail::processMsg:ismultipart %d mime subtype '%s'\n",
|
342 |
doc->isMultipart(), doc->getSubType().c_str()));
|
354 |
doc->isMultipart(), doc->getSubType().c_str()));
|
343 |
walkmime(doc, depth);
|
355 |
walkmime(doc, depth);
|
344 |
|
356 |
|
345 |
LOGDEB2(("MimeHandlerMail::processMsg:text:[%s]\n",
|
357 |
LOGDEB2(("MimeHandlerMail::processMsg:text:[%s]\n",
|