'LibPst'
msg.cpp
Go to the documentation of this file.
1 extern "C" {
2  #include "define.h"
3  #include "msg.h"
4  #include <gsf/gsf-utils.h>
5 
6  #include <gsf/gsf-input-stdio.h>
7  #include <gsf/gsf-infile.h>
8  #include <gsf/gsf-infile-stdio.h>
9 
10  #include <gsf/gsf-output-stdio.h>
11  #include <gsf/gsf-outfile.h>
12  #include <gsf/gsf-outfile-msole.h>
13 }
14 
15 #include <list>
16 #include <vector>
17 #include <string>
18 
19 using namespace std;
20 
21 struct property {
22  uint32_t tag;
23  uint32_t flags;
24  uint32_t length; // or value
25  uint32_t reserved;
26 };
27 typedef list<property> property_list;
28 
29 
35 static void convert_8bit(pst_string &str, const char *charset);
36 static void convert_8bit(pst_string &str, const char *charset) {
37  if (!str.str) return; // null
38  if (!str.is_utf8) return; // not utf8
39 
40  DEBUG_ENT("convert_8bit");
41  pst_vbuf *newer = pst_vballoc(2);
42  size_t strsize = strlen(str.str);
43  size_t rc = pst_vb_utf8to8bit(newer, str.str, strsize, charset);
44  if (rc == (size_t)-1) {
45  // unable to convert, change the charset to utf8
46  free(newer->b);
47  DEBUG_INFO(("Failed to convert utf-8 to %s\n", charset));
48  DEBUG_HEXDUMPC(str.str, strsize, 0x10);
49  }
50  else {
51  // null terminate the output string
52  pst_vbgrow(newer, 1);
53  newer->b[newer->dlen] = '\0';
54  free(str.str);
55  str.str = newer->b;
56  }
57  free(newer);
58  DEBUG_RET();
59 }
60 
61 
62 static void empty_property(GsfOutfile *out, uint32_t tag);
63 static void empty_property(GsfOutfile *out, uint32_t tag) {
64  vector<char> n(50);
65  snprintf(&n[0], n.size(), "__substg1.0_%08X", tag);
66  GsfOutput* dst = gsf_outfile_new_child(out, &n[0], false);
67  gsf_output_close(dst);
68  g_object_unref(G_OBJECT(dst));
69 }
70 
71 
72 static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, const char *contents, size_t size);
73 static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, const char *contents, size_t size) {
74  if (!contents) return;
75  size_t term = ((tag & 0x0000ffff) == 0x001e) ? 1 :
76  ((tag & 0x0000ffff) == 0x001f) ? 2 : 0; // null terminator
77  vector<char> n(50);
78  snprintf(&n[0], n.size(), "__substg1.0_%08X", tag);
79  GsfOutput* dst = gsf_outfile_new_child(out, &n[0], false);
80  gsf_output_write(dst, size, (const guint8*)contents);
81  if (term) {
82  memset(&n[0], 0, term);
83  gsf_output_write(dst, term, (const guint8*)&n[0]);
84  size += term;
85  }
86  gsf_output_close(dst);
87  g_object_unref(G_OBJECT(dst));
88 
89  property p;
90  p.tag = tag;
91  p.flags = 0x6; // make all the properties writable
92  p.length = size;
93  p.reserved = 0;
94  prop.push_back(p);
95 }
96 
97 
98 static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, FILE *fp);
99 static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, FILE *fp) {
100  vector<char> n(50);
101  snprintf(&n[0], n.size(), "__substg1.0_%08X", tag);
102  GsfOutput* dst = gsf_outfile_new_child(out, &n[0], false);
103 
104  size_t size = 0;
105  const size_t bsize = 10000;
106  char buf[bsize];
107 
108  while (1) {
109  size_t s = fread(buf, 1, bsize, fp);
110  if (!s) break;
111  gsf_output_write(dst, s, (const guint8*)buf);
112  }
113 
114  gsf_output_close(dst);
115  g_object_unref(G_OBJECT(dst));
116 
117  property p;
118  p.tag = tag;
119  p.flags = 0x6; // make all the properties writable
120  p.length = size;
121  p.reserved = 0;
122  prop.push_back(p);
123 }
124 
125 
126 static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, const char* charset, pst_string &contents);
127 static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, const char* charset, pst_string &contents) {
128  if (contents.str) {
129  convert_8bit(contents, charset);
130  string_property(out, prop, tag, contents.str, strlen(contents.str));
131  }
132 }
133 
134 
135 static void strin0_property(GsfOutfile *out, property_list &prop, uint32_t tag, const char* charset, pst_string &contents);
136 static void strin0_property(GsfOutfile *out, property_list &prop, uint32_t tag, const char* charset, pst_string &contents) {
137  if (contents.str) {
138  convert_8bit(contents, charset);
139  string_property(out, prop, tag, contents.str, strlen(contents.str)+1);
140  }
141 }
142 
143 
144 static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, const string &contents);
145 static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, const string &contents) {
146  string_property(out, prop, tag, contents.c_str(), contents.size());
147 }
148 
149 
150 static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, pst_binary &contents);
151 static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, pst_binary &contents) {
152  if (contents.size) string_property(out, prop, tag, contents.data, contents.size);
153 }
154 
155 
156 static void write_properties(GsfOutfile *out, property_list &prop, const guint8* header, size_t hlen);
157 static void write_properties(GsfOutfile *out, property_list &prop, const guint8* header, size_t hlen) {
158  GsfOutput* dst = gsf_outfile_new_child(out, "__properties_version1.0", false);
159  gsf_output_write(dst, hlen, header);
160  for (property_list::iterator i=prop.begin(); i!=prop.end(); i++) {
161  property &p = *i;
162  gsf_output_write(dst, sizeof(property), (const guint8*)&p);
163  }
164  gsf_output_close(dst);
165  g_object_unref(G_OBJECT(dst));
166 }
167 
168 
169 static void int_property(property_list &prop_list, uint32_t tag, uint32_t flags, uint32_t value);
170 static void int_property(property_list &prop_list, uint32_t tag, uint32_t flags, uint32_t value) {
171  property p;
172  p.tag = tag;
173  p.flags = flags;
174  p.length = value;
175  p.reserved = 0;
176  prop_list.push_back(p);
177 }
178 
179 
180 static void i64_property(property_list &prop_list, uint32_t tag, uint32_t flags, FILETIME *value);
181 static void i64_property(property_list &prop_list, uint32_t tag, uint32_t flags, FILETIME *value) {
182  if (value) {
183  property p;
184  p.tag = tag;
185  p.flags = flags;
186  p.length = value->dwLowDateTime;
187  p.reserved = value->dwHighDateTime;
188  prop_list.push_back(p);
189  }
190 }
191 
192 
193 static void nzi_property(property_list &prop_list, uint32_t tag, uint32_t flags, uint32_t value);
194 static void nzi_property(property_list &prop_list, uint32_t tag, uint32_t flags, uint32_t value) {
195  if (value) int_property(prop_list, tag, flags, value);
196 }
197 
198 
199 void write_msg_email(char *fname, pst_item* item, pst_file* pst) {
200  // this is not an email item
201  if (!item->email) return;
202  DEBUG_ENT("write_msg_email");
203 
204  pst_item_email &email = *(item->email);
205 
206  char charset[30];
207  const char* body_charset = pst_default_charset(item, sizeof(charset), charset);
208  DEBUG_INFO(("%s body charset seems to be %s\n", fname, body_charset));
209  body_charset = "iso-8859-1//TRANSLIT//IGNORE";
210 
211  gsf_init();
212 
213  GsfOutfile *outfile;
214  GsfOutput *output;
215  GError *err = NULL;
216 
217  output = gsf_output_stdio_new(fname, &err);
218  if (output == NULL) {
219  gsf_shutdown();
220  DEBUG_INFO(("unable to open output .msg file %s\n", fname));
221  DEBUG_RET();
222  return;
223  }
224 
225  struct top_property_header {
226  uint32_t reserved1;
227  uint32_t reserved2;
228  uint32_t next_recipient; // same as recipient count
229  uint32_t next_attachment; // same as attachment count
230  uint32_t recipient_count;
231  uint32_t attachment_count;
232  uint32_t reserved3;
233  uint32_t reserved4;
234  };
235 
236  top_property_header top_head;
237  memset(&top_head, 0, sizeof(top_head));
238 
239  outfile = gsf_outfile_msole_new(output);
240  g_object_unref(G_OBJECT(output));
241 
242  output = GSF_OUTPUT(outfile);
243  property_list prop_list;
244 
245  int_property(prop_list, 0x00170003, 0x6, email.importance);
246  nzi_property(prop_list, 0x0023000B, 0x6, email.delivery_report);
247  nzi_property(prop_list, 0x00260003, 0x6, email.priority);
248  nzi_property(prop_list, 0x0029000B, 0x6, email.read_receipt);
249  nzi_property(prop_list, 0x002E0003, 0x6, email.original_sensitivity);
250  nzi_property(prop_list, 0x00360003, 0x6, email.sensitivity);
251  nzi_property(prop_list, 0x0C17000B, 0x6, email.reply_requested);
252  nzi_property(prop_list, 0x0E01000B, 0x6, email.delete_after_submit);
253  int_property(prop_list, 0x0E070003, 0x6, item->flags);
254  i64_property(prop_list, 0x00390040, 0x6, email.sent_date);
255  GsfOutfile *out = GSF_OUTFILE (output);
256  string_property(out, prop_list, 0x001A001E, item->ascii_type);
257  string_property(out, prop_list, 0x0037001E, body_charset, item->subject);
258  strin0_property(out, prop_list, 0x003B0102, body_charset, email.outlook_sender);
259  string_property(out, prop_list, 0x003D001E, string(""));
260  string_property(out, prop_list, 0x0040001E, body_charset, email.outlook_received_name1);
261  string_property(out, prop_list, 0x0042001E, body_charset, email.outlook_sender_name);
262  string_property(out, prop_list, 0x0044001E, body_charset, email.outlook_recipient_name);
263  string_property(out, prop_list, 0x0050001E, body_charset, email.reply_to);
264  strin0_property(out, prop_list, 0x00510102, body_charset, email.outlook_recipient);
265  strin0_property(out, prop_list, 0x00520102, body_charset, email.outlook_recipient2);
266  string_property(out, prop_list, 0x0064001E, body_charset, email.sender_access);
267  string_property(out, prop_list, 0x0065001E, body_charset, email.sender_address);
268  string_property(out, prop_list, 0x0070001E, body_charset, email.processed_subject);
269  string_property(out, prop_list, 0x00710102, email.conversation_index);
270  string_property(out, prop_list, 0x0072001E, body_charset, email.original_bcc);
271  string_property(out, prop_list, 0x0073001E, body_charset, email.original_cc);
272  string_property(out, prop_list, 0x0074001E, body_charset, email.original_to);
273  string_property(out, prop_list, 0x0075001E, body_charset, email.recip_access);
274  string_property(out, prop_list, 0x0076001E, body_charset, email.recip_address);
275  string_property(out, prop_list, 0x0077001E, body_charset, email.recip2_access);
276  string_property(out, prop_list, 0x0078001E, body_charset, email.recip2_address);
277  string_property(out, prop_list, 0x007D001E, body_charset, email.header);
278  string_property(out, prop_list, 0x0C1A001E, body_charset, email.outlook_sender_name2);
279  strin0_property(out, prop_list, 0x0C1D0102, body_charset, email.outlook_sender2);
280  string_property(out, prop_list, 0x0C1E001E, body_charset, email.sender2_access);
281  string_property(out, prop_list, 0x0C1F001E, body_charset, email.sender2_address);
282  string_property(out, prop_list, 0x0E02001E, body_charset, email.bcc_address);
283  string_property(out, prop_list, 0x0E03001E, body_charset, email.cc_address);
284  string_property(out, prop_list, 0x0E04001E, body_charset, email.sentto_address);
285  string_property(out, prop_list, 0x0E1D001E, body_charset, email.outlook_normalized_subject);
286  string_property(out, prop_list, 0x1000001E, body_charset, item->body);
287  string_property(out, prop_list, 0x1013001E, body_charset, email.htmlbody);
288  string_property(out, prop_list, 0x1035001E, body_charset, email.messageid);
289  string_property(out, prop_list, 0x1042001E, body_charset, email.in_reply_to);
290  string_property(out, prop_list, 0x1046001E, body_charset, email.return_path_address);
291  // any property over 0x8000 needs entries in the __nameid to make them
292  // either string named or numerical named properties.
293 
294  {
295  vector<char> n(50);
296  {
297  snprintf(&n[0], n.size(), "__recip_version1.0_#%08X", top_head.recipient_count);
298  GsfOutput *output = gsf_outfile_new_child(out, &n[0], true);
299  {
300  int v = 1; // to
301  property_list prop_list;
302  int_property(prop_list, 0x0C150003, 0x6, v); // PidTagRecipientType
303  int_property(prop_list, 0x30000003, 0x6, top_head.recipient_count); // PR_ROWID
304  GsfOutfile *out = GSF_OUTFILE (output);
305  string_property(out, prop_list, 0x3001001E, body_charset, item->file_as);
306  if (item->contact) {
307  string_property(out, prop_list, 0x3002001E, body_charset, item->contact->address1_transport);
308  string_property(out, prop_list, 0x3003001E, body_charset, item->contact->address1);
309  string_property(out, prop_list, 0x5ff6001E, body_charset, item->contact->address1);
310  }
311  strin0_property(out, prop_list, 0x300B0102, body_charset, email.outlook_search_key);
312  write_properties(out, prop_list, (const guint8*)&top_head, 8); // convenient 8 bytes of reserved zeros
313  gsf_output_close(output);
314  g_object_unref(G_OBJECT(output));
315  top_head.next_recipient++;
316  top_head.recipient_count++;
317  }
318  }
319  if (email.cc_address.str) {
320  snprintf(&n[0], n.size(), "__recip_version1.0_#%08X", top_head.recipient_count);
321  GsfOutput *output = gsf_outfile_new_child(out, &n[0], true);
322  {
323  int v = 2; // cc
324  property_list prop_list;
325  int_property(prop_list, 0x0C150003, 0x6, v); // PidTagRecipientType
326  int_property(prop_list, 0x30000003, 0x6, top_head.recipient_count); // PR_ROWID
327  GsfOutfile *out = GSF_OUTFILE (output);
328  string_property(out, prop_list, 0x3001001E, body_charset, email.cc_address);
329  string_property(out, prop_list, 0x3003001E, body_charset, email.cc_address);
330  string_property(out, prop_list, 0x5ff6001E, body_charset, email.cc_address);
331  write_properties(out, prop_list, (const guint8*)&top_head, 8); // convenient 8 bytes of reserved zeros
332  gsf_output_close(output);
333  g_object_unref(G_OBJECT(output));
334  top_head.next_recipient++;
335  top_head.recipient_count++;
336  }
337  }
338  if (email.bcc_address.str) {
339  snprintf(&n[0], n.size(), "__recip_version1.0_#%08X", top_head.recipient_count);
340  GsfOutput *output = gsf_outfile_new_child(out, &n[0], true);
341  {
342  int v = 3; // bcc
343  property_list prop_list;
344  int_property(prop_list, 0x0C150003, 0x6, v); // PidTagRecipientType
345  int_property(prop_list, 0x30000003, 0x6, top_head.recipient_count); // PR_ROWID
346  GsfOutfile *out = GSF_OUTFILE (output);
347  string_property(out, prop_list, 0x3001001E, body_charset, email.bcc_address);
348  string_property(out, prop_list, 0x3003001E, body_charset, email.bcc_address);
349  string_property(out, prop_list, 0x5ff6001E, body_charset, email.bcc_address);
350  write_properties(out, prop_list, (const guint8*)&top_head, 8); // convenient 8 bytes of reserved zeros
351  gsf_output_close(output);
352  g_object_unref(G_OBJECT(output));
353  top_head.next_recipient++;
354  top_head.recipient_count++;
355  }
356  }
357  }
358 
359  pst_item_attach *a = item->attach;
360  while (a) {
361  if (a->method == PST_ATTACH_EMBEDDED) {
362  // not implemented yet
363  }
364  else if (a->data.data || a->i_id) {
365  vector<char> n(50);
366  snprintf(&n[0], n.size(), "__attach_version1.0_#%08X", top_head.attachment_count);
367  GsfOutput *output = gsf_outfile_new_child(out, &n[0], true);
368  {
369  FILE *fp = fopen("temp_file_attachment", "w+b");
370  if (fp) {
371  pst_attach_to_file(pst, a, fp); // data is now in the file
372  fseek(fp, 0, SEEK_SET);
373  property_list prop_list;
374  int_property(prop_list, 0x0E210003, 0x2, top_head.attachment_count); // MAPI_ATTACH_NUM
375  int_property(prop_list, 0x0FF40003, 0x2, 2); // PR_ACCESS read
376  int_property(prop_list, 0x0FF70003, 0x2, 0); // PR_ACCESS_LEVEL read only
377  int_property(prop_list, 0x0FFE0003, 0x2, 7); // PR_OBJECT_TYPE attachment
378  int_property(prop_list, 0x37050003, 0x7, 1); // PR_ATTACH_METHOD by value
379  int_property(prop_list, 0x370B0003, 0x7, a->position); // PR_RENDERING_POSITION
380  int_property(prop_list, 0x37100003, 0x6, a->sequence); // PR_ATTACH_MIME_SEQUENCE
381  GsfOutfile *out = GSF_OUTFILE (output);
382  string_property(out, prop_list, 0x0FF90102, item->record_key);
383  string_property(out, prop_list, 0x37010102, fp);
384  if (a->filename2.str) {
385  // have long file name
386  string_property(out, prop_list, 0x3707001E, body_charset, a->filename2);
387  }
388  else if (a->filename1.str) {
389  // have short file name
390  string_property(out, prop_list, 0x3704001E, body_charset, a->filename1);
391  }
392  else {
393  // make up a name
394  const char *n = "inline";
395  string_property(out, prop_list, 0x3704001E, n, strlen(n));
396  }
397  string_property(out, prop_list, 0x370E001E, body_charset, a->mimetype);
398  write_properties(out, prop_list, (const guint8*)&top_head, 8); // convenient 8 bytes of reserved zeros
399  gsf_output_close(output);
400  g_object_unref(G_OBJECT(output));
401  top_head.next_attachment++;
402  top_head.attachment_count++;
403  fclose(fp);
404  }
405  }
406  }
407  a = a->next;
408  }
409 
410  write_properties(out, prop_list, (const guint8*)&top_head, sizeof(top_head));
411 
412  {
413  GsfOutput *output = gsf_outfile_new_child(out, "__nameid_version1.0", true);
414  {
415  GsfOutfile *out = GSF_OUTFILE (output);
416  empty_property(out, 0x00020102);
417  empty_property(out, 0x00030102);
418  empty_property(out, 0x00040102);
419  gsf_output_close(output);
420  g_object_unref(G_OBJECT(output));
421  }
422  }
423 
424  gsf_output_close(output);
425  g_object_unref(G_OBJECT(output));
426 
427  gsf_shutdown();
428  DEBUG_RET();
429 }
430 
pst_string sender_address
mapi element 0x0065 PR_SENT_REPRESENTING_EMAIL_ADDRESS
Definition: libpst.h:299
pst_string original_cc
mapi element 0x0073 PR_ORIGINAL_DISPLAY_CC
Definition: libpst.h:225
pst_string outlook_received_name1
mapi element 0x0040 PR_RECEIVED_BY_NAME
Definition: libpst.h:331
pst_item_contact * contact
contact mapi elements
Definition: libpst.h:790
int32_t importance
mapi element 0x0017 PR_IMPORTANCE
Definition: libpst.h:199
int32_t flags
mapi element 0x0e07 PR_MESSAGE_FLAGS
Definition: libpst.h:825
pst_string subject
mapi element 0x0037 PR_SUBJECT
Definition: libpst.h:835
pst_vbuf * pst_vballoc(size_t len)
Definition: vbuf.c:130
pst_binary record_key
mapi element 0x0ff9 PR_RECORD_KEY
Definition: libpst.h:845
pst_string header
mapi element 0x007d PR_TRANSPORT_MESSAGE_HEADERS
Definition: libpst.h:192
int32_t original_sensitivity
mapi element 0x002e PR_ORIGINAL_SENSITIVITY
Definition: libpst.h:221
pst_binary conversation_index
mapi element 0x0071 PR_CONVERSATION_INDEX
Definition: libpst.h:174
int delete_after_submit
mapi element 0x0e01 PR_DELETE_AFTER_SUBMIT
Definition: libpst.h:182
pst_string processed_subject
mapi element 0x0070 PR_CONVERSATION_TOPIC
Definition: libpst.h:247
char * ascii_type
mapi element 0x001a PR_MESSAGE_CLASS or 0x3613 PR_CONTAINER_CLASS
Definition: libpst.h:813
void write_msg_email(char *fname, pst_item *item, pst_file *pst)
Definition: msg.cpp:199
size_t dlen
Definition: vbuf.h:10
pst_string address1_transport
mapi element 0x3002 PR_ADDRTYPE, or 0x8082
Definition: libpst.h:407
Definition: vbuf.h:9
static void nzi_property(property_list &prop_list, uint32_t tag, uint32_t flags, uint32_t value)
Definition: msg.cpp:194
size_t size
Definition: libpst.h:154
pst_string outlook_sender
mapi element 0x003b PR_SENT_REPRESENTING_SEARCH_KEY
Definition: libpst.h:235
pst_string sender2_access
mapi element 0x0c1e PR_SENDER_ADDRTYPE
Definition: libpst.h:301
#define DEBUG_INFO(x)
Definition: define.h:166
This contains the common mapi elements, and pointers to structures for each major mapi item type...
Definition: libpst.h:780
#define DEBUG_ENT(x)
Definition: define.h:171
list< property > property_list
Definition: msg.cpp:27
int32_t method
mapi element 0x3705 PR_ATTACH_METHOD
Definition: libpst.h:633
uint32_t tag
Definition: msg.cpp:22
static void convert_8bit(pst_string &str, const char *charset)
Convert str to an 8 bit charset if it is utf8, null strings are preserved.
Definition: msg.cpp:36
static void write_properties(GsfOutfile *out, property_list &prop, const guint8 *header, size_t hlen)
Definition: msg.cpp:157
#define DEBUG_RET()
Definition: define.h:176
This contains the attachment related mapi elements.
Definition: libpst.h:608
const char * pst_default_charset(pst_item *item, int buflen, char *result)
Get the default character set for this item.
Definition: libpst.c:4451
pst_string reply_to
mapi element 0x0050 PR_REPLY_RECIPIENT_NAMES
Definition: libpst.h:265
pst_string outlook_recipient_name
mapi element 0x0044 PR_RCVD_REPRESENTING_NAME
Definition: libpst.h:231
pst_binary data
mapi element 0x3701 PR_ATTACH_DATA_OBJ
Definition: libpst.h:618
a simple wrapper for binary blobs
Definition: libpst.h:153
pst_string file_as
mapi element 0x3001 PR_DISPLAY_NAME
Definition: libpst.h:827
pst_string messageid
mapi element 0x1035
Definition: libpst.h:215
#define PST_ATTACH_EMBEDDED
Definition: libpst.h:86
uint32_t length
Definition: msg.cpp:24
pst_string outlook_sender_name2
mapi element 0x0c1a PR_SENDER_NAME
Definition: libpst.h:333
pst_string outlook_search_key
mapi element 0x300b PR_SEARCH_KEY
Definition: libpst.h:337
The string is either utf8 encoded, or it is in the code page specified by the containing mapi object...
Definition: libpst.h:144
size_t pst_vb_utf8to8bit(pst_vbuf *dest, const char *inbuf, int iblen, const char *charset)
Definition: vbuf.c:246
pst_string recip2_address
mapi element 0x0078 PR_RCVD_REPRESENTING_EMAIL_ADDRESS
Definition: libpst.h:259
int32_t priority
mapi element 0x0026 PR_PRIORITY
Definition: libpst.h:245
pst_string recip_access
mapi element 0x0075 PR_RECEIVED_BY_ADDRTYPE
Definition: libpst.h:253
pst_string outlook_recipient2
mapi element 0x0052 PR_RCVD_REPRESENTING_SEARCH_KEY
Definition: libpst.h:233
pst_string mimetype
mapi element 0x370e PR_ATTACH_MIME_TAG
Definition: libpst.h:614
void pst_vbgrow(pst_vbuf *vb, size_t len)
out: vbavail(vb) >= len, data are preserved
Definition: vbuf.c:146
pst_string cc_address
mapi element 0x0e03 PR_DISPLAY_CC
Definition: libpst.h:170
char * data
Definition: libpst.h:155
pst_string sentto_address
mapi element 0x0e04 PR_DISPLAY_TO
Definition: libpst.h:315
FILETIME * sent_date
mapi element 0x0039 PR_CLIENT_SUBMIT_TIME
Definition: libpst.h:311
int delivery_report
mapi element 0x0023 PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED
Definition: libpst.h:186
pst_string filename1
mapi element 0x3704 PR_ATTACH_FILENAME
Definition: libpst.h:610
pst_string body
mapi element 0x1000 PR_BODY
Definition: libpst.h:833
Definition: msg.cpp:21
uint32_t flags
Definition: msg.cpp:23
static void int_property(property_list &prop_list, uint32_t tag, uint32_t flags, uint32_t value)
Definition: msg.cpp:170
#define DEBUG_HEXDUMPC(x, s, c)
Definition: define.h:168
uint32_t dwLowDateTime
Definition: common.h:28
char * b
Definition: vbuf.h:13
uint32_t dwHighDateTime
Definition: common.h:29
pst_string sender_access
mapi element 0x0064 PR_SENT_REPRESENTING_ADDRTYPE
Definition: libpst.h:297
pst_string outlook_recipient
mapi element 0x0051 PR_RECEIVED_BY_SEARCH_KEY
Definition: libpst.h:229
int read_receipt
mapi element 0x0029 PR_READ_RECEIPT_REQUESTED
Definition: libpst.h:251
uint64_t i_id
calculated from id2_val during creation of record
Definition: libpst.h:622
pst_string bcc_address
mapi element 0x0e02 PR_DISPLAY_BCC
Definition: libpst.h:172
static void strin0_property(GsfOutfile *out, property_list &prop, uint32_t tag, const char *charset, pst_string &contents)
Definition: msg.cpp:136
pst_string htmlbody
mapi element 0x1013
Definition: libpst.h:194
int32_t sequence
mapi element 0x3710 PR_ATTACH_MIME_SEQUENCE
Definition: libpst.h:637
int reply_requested
mapi element 0x0c17 PR_REPLY_REQUESTED
Definition: libpst.h:263
pst_string in_reply_to
mapi element 0x1042
Definition: libpst.h:201
pst_string outlook_normalized_subject
mapi element 0x0e1d PR_NORMALIZED_SUBJECT
Definition: libpst.h:335
pst_string outlook_sender_name
mapi element 0x0042 PR_SENT_REPRESENTING_NAME
Definition: libpst.h:237
uint32_t reserved
Definition: msg.cpp:25
int is_utf8
Definition: libpst.h:147
pst_string sender2_address
mapi element 0x0c1f PR_SENDER_EMAIL_ADDRESS
Definition: libpst.h:303
This contains the email related mapi elements.
Definition: libpst.h:161
pst_string return_path_address
mapi element 0x1046, this seems to be the message-id of the rfc822 mail that is being returned ...
Definition: libpst.h:267
pst_string filename2
mapi element 0x3707 PR_ATTACH_LONG_FILENAME
Definition: libpst.h:612
size_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE *fp)
Write a binary attachment to a file.
Definition: libpst.c:600
pst_string recip_address
mapi element 0x0076 PR_RECEIVED_BY_EMAIL_ADDRESS
Definition: libpst.h:255
static void i64_property(property_list &prop_list, uint32_t tag, uint32_t flags, FILETIME *value)
Definition: msg.cpp:181
static void empty_property(GsfOutfile *out, uint32_t tag)
Definition: msg.cpp:63
pst_item_email * email
email mapi elements
Definition: libpst.h:786
int32_t sensitivity
mapi element 0x0036 PR_SENSITIVITY
Definition: libpst.h:309
pst_item_attach * attach
linked list of attachments
Definition: libpst.h:792
pst_string address1
mapi element 0x3003 PR_EMAIL_ADDRESS, or 0x8083
Definition: libpst.h:401
pst_string recip2_access
mapi element 0x0077 PR_RCVD_REPRESENTING_ADDRTYPE
Definition: libpst.h:257
pst_string original_to
mapi element 0x0074 PR_ORIGINAL_DISPLAY_TO
Definition: libpst.h:227
struct pst_item_attach * next
Definition: libpst.h:638
int32_t position
mapi element 0x370b PR_RENDERING_POSITION
Definition: libpst.h:635
pst_string outlook_sender2
mapi element 0x0c1d PR_SENDER_SEARCH_KEY
Definition: libpst.h:239
pst_string original_bcc
mapi element 0x0072 PR_ORIGINAL_DISPLAY_BCC
Definition: libpst.h:223
static void string_property(GsfOutfile *out, property_list &prop, uint32_t tag, const char *contents, size_t size)
Definition: msg.cpp:73
char * str
Definition: libpst.h:148