libpst.so.4
libpst.h
Go to the documentation of this file.
1 /***
2  * libpst.h
3  * Part of LibPST project
4  * Written by David Smith
5  * dave.s@earthcorp.com
6  */
7 // LibPST - Library for Accessing Outlook .pst files
8 // Dave Smith - davesmith@users.sourceforge.net
9 
10 #ifndef __PST_LIBPST_H
11 #define __PST_LIBPST_H
12 
13 #include "common.h"
14 
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 
21 // switch to maximal packing for all structures in the libpst interface
22 // this is reverted at the end of this file
23 #ifdef _MSC_VER
24  #pragma pack(push, 1)
25 #endif
26 #if defined(__GNUC__) || defined (__SUNPRO_C) || defined(__SUNPRO_CC)
27  #pragma pack(1)
28 #endif
29 
30 
31 #define PST_TYPE_NOTE 1
32 #define PST_TYPE_SCHEDULE 2
33 #define PST_TYPE_APPOINTMENT 8
34 #define PST_TYPE_CONTACT 9
35 #define PST_TYPE_JOURNAL 10
36 #define PST_TYPE_STICKYNOTE 11
37 #define PST_TYPE_TASK 12
38 #define PST_TYPE_OTHER 13
39 #define PST_TYPE_REPORT 14
40 #define PST_TYPE_MAX 15
41 
42 // defines types of possible encryption
43 #define PST_NO_ENCRYPT 0
44 #define PST_COMP_ENCRYPT 1
45 #define PST_ENCRYPT 2
46 
47 // defines different types of mappings
48 #define PST_MAP_ATTRIB (uint32_t)1
49 #define PST_MAP_HEADER (uint32_t)2
50 
51 // define my custom email attributes.
52 #define PST_ATTRIB_HEADER -1
53 
54 // defines types of free/busy values for appointment->showas
55 #define PST_FREEBUSY_FREE 0
56 #define PST_FREEBUSY_TENTATIVE 1
57 #define PST_FREEBUSY_BUSY 2
58 #define PST_FREEBUSY_OUT_OF_OFFICE 3
59 
60 // defines labels for appointment->label
61 #define PST_APP_LABEL_NONE 0
62 #define PST_APP_LABEL_IMPORTANT 1
63 #define PST_APP_LABEL_BUSINESS 2
64 #define PST_APP_LABEL_PERSONAL 3
65 #define PST_APP_LABEL_VACATION 4
66 #define PST_APP_LABEL_MUST_ATTEND 5
67 #define PST_APP_LABEL_TRAVEL_REQ 6
68 #define PST_APP_LABEL_NEEDS_PREP 7
69 #define PST_APP_LABEL_BIRTHDAY 8
70 #define PST_APP_LABEL_ANNIVERSARY 9
71 #define PST_APP_LABEL_PHONE_CALL 10
72 
73 // define type of recurring event
74 #define PST_APP_RECUR_NONE 0
75 #define PST_APP_RECUR_DAILY 1
76 #define PST_APP_RECUR_WEEKLY 2
77 #define PST_APP_RECUR_MONTHLY 3
78 #define PST_APP_RECUR_YEARLY 4
79 
80 // define attachment types
81 #define PST_ATTACH_NONE 0
82 #define PST_ATTACH_BY_VALUE 1
83 #define PST_ATTACH_BY_REF 2
84 #define PST_ATTACH_BY_REF_RESOLV 3
85 #define PST_ATTACH_BY_REF_ONLY 4
86 #define PST_ATTACH_EMBEDDED 5
87 #define PST_ATTACH_OLE 6
88 
89 // define flags
90 #define PST_FLAG_READ 0x01
91 #define PST_FLAG_UNMODIFIED 0x02
92 #define PST_FLAG_SUBMIT 0x04
93 #define PST_FLAG_UNSENT 0x08
94 #define PST_FLAG_HAS_ATTACHMENT 0x10
95 #define PST_FLAG_FROM_ME 0x20
96 #define PST_FLAG_ASSOCIATED 0x40
97 #define PST_FLAG_RESEND 0x80
98 #define PST_FLAG_RN_PENDING 0x100
99 #define PST_FLAG_NRN_PENDING 0x200
100 
101 
102 typedef struct pst_entryid {
103  int32_t u1;
104  char entryid[16];
105  uint32_t id;
106 } pst_entryid;
107 
108 
109 typedef struct pst_index_ll {
110  uint64_t i_id;
111  uint64_t offset;
112  uint64_t size;
113  uint64_t inflated_size;
114  int64_t u1;
115 } pst_index_ll;
116 
117 
118 typedef struct pst_id2_tree {
119  uint64_t id2;
123 } pst_id2_tree;
124 
125 
126 typedef struct pst_desc_tree {
127  uint64_t d_id;
128  uint64_t parent_d_id;
131  int32_t no_child;
137 } pst_desc_tree;
138 
139 
144 typedef struct pst_string {
147  int is_utf8;
148  char *str;
149 } pst_string;
150 
151 
153 typedef struct pst_binary {
154  size_t size;
155  char *data;
156 } pst_binary;
157 
158 
161 typedef struct pst_item_email {
199  int32_t importance;
245  int32_t priority;
273  int32_t rtf_body_crc;
309  int32_t sensitivity;
323  int32_t ndr_diag_code;
328 
329  // elements added for .msg processing
339 
340 
343 typedef struct pst_item_folder {
345  int32_t item_count;
351  int32_t assoc_count;
358 
359 
362 typedef struct pst_item_message_store {
389  int32_t valid_mask;
391  int32_t pwd_chksum;
393 
394 
397 typedef struct pst_item_contact {
486  int16_t gender;
604 
605 
608 typedef struct pst_item_attach {
620  uint64_t id2_val;
622  uint64_t i_id;
633  int32_t method;
635  int32_t position;
637  int32_t sequence;
640 
641 
643 typedef struct pst_item_extra_field {
644  char *field_name;
645  char *value;
648 
649 
652 typedef struct pst_item_journal {
662 
663 
667 typedef struct pst_recurrence {
669  uint32_t signature;
674  uint32_t type;
681  uint32_t sub_type;
683  uint32_t parm1;
684  uint32_t parm2;
685  uint32_t parm3;
686  uint32_t parm4;
687  uint32_t parm5;
693  uint32_t termination;
695  uint32_t interval;
697  uint32_t bydaymask;
699  uint32_t dayofmonth;
701  uint32_t monthofyear;
703  uint32_t position;
705  uint32_t count;
706  // there is more data, including the termination date,
707  // but we can get that from other mapi elements.
709 
710 
713 typedef struct pst_item_appointment {
723  int alarm;
727  int32_t alarm_minutes;
737  int32_t showas;
750  int32_t label;
754  int all_day;
775 
776 
780 typedef struct pst_item {
782  struct pst_file *pf;
784  uint64_t block_id;
811  int type;
813  char *ascii_type;
825  int32_t flags;
837  int32_t internet_cpid;
841  int32_t message_size;
860 } pst_item;
861 
862 
871 typedef struct pst_x_attrib_ll {
875  uint32_t mytype;
877  uint32_t map;
879  void *data;
883 
884 
886 typedef struct pst_block_recorder {
888  int64_t offset;
889  size_t size;
892 
893 
894 typedef struct pst_file {
896  FILE* fp;
898  char* cwd;
900  char* fname;
902  const char* charset;
914 
920  uint64_t index1;
922  uint64_t index1_back;
924  uint64_t index2;
926  uint64_t index2_back;
928  uint64_t size;
932  unsigned char encryption;
938  unsigned char ind_type;
939 } pst_file;
940 
941 
949 int pst_open(pst_file *pf, const char *name, const char *charset);
950 
951 
956 int pst_reopen(pst_file *pf);
957 
958 
964 int pst_load_index (pst_file *pf);
965 
966 
972 
973 
977 int pst_close(pst_file *pf);
978 
979 
986 
987 
995 
996 
1002 size_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE* fp);
1003 
1004 
1010 size_t pst_attach_to_file_base64(pst_file *pf, pst_item_attach *attach, FILE* fp);
1011 
1012 
1018 
1019 
1028 
1029 
1033 void pst_freeItem(pst_item *item);
1034 
1035 
1041 pst_index_ll* pst_getID(pst_file* pf, uint64_t i_id);
1042 
1043 
1051 size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t i_id, char **buf);
1052 
1053 
1057 int pst_stricmp(char *a, char *b);
1058 
1059 
1067 size_t pst_fwrite(const void* ptr, size_t size, size_t nmemb, FILE* stream);
1068 
1069 
1078 char* pst_rfc2426_escape(char* str, char** result, size_t* resultlen);
1079 
1080 
1088 char* pst_rfc2425_datetime_format(const FILETIME* ft, int buflen, char* result);
1089 
1090 
1097 char* pst_rfc2445_datetime_format(const FILETIME* ft, int buflen, char* result);
1098 
1099 
1105 char* pst_rfc2445_datetime_format_now(int buflen, char* result);
1106 
1107 
1115 const char* pst_default_charset(pst_item *item, int buflen, char* result);
1116 
1117 
1121 void pst_rfc2231(pst_string *str);
1122 
1123 
1129 void pst_rfc2047(pst_item *item, pst_string *str, int needs_quote);
1130 
1131 
1136 void pst_convert_utf8_null(pst_item *item, pst_string *str);
1137 
1138 
1143 void pst_convert_utf8(pst_item *item, pst_string *str);
1144 
1145 
1151 
1152 
1157 
1158 
1159 
1160 // switch from maximal packing back to default packing
1161 // undo the packing from the beginning of this file
1162 #ifdef _MSC_VER
1163  #pragma pack(pop)
1164 #endif
1165 #if defined(__GNUC__) || defined (__SUNPRO_C) || defined(__SUNPRO_CC)
1166  #pragma pack()
1167 #endif
1168 
1169 
1170 
1171 #ifdef __cplusplus
1172 }
1173 #endif
1174 
1175 
1176 
1177 #endif
pst_string sender_address
mapi element 0x0065 PR_SENT_REPRESENTING_EMAIL_ADDRESS
Definition: libpst.h:299
int32_t valid_mask
mapi element 0x35df, bit mask of folders in this message store
Definition: libpst.h:389
pst_string original_cc
mapi element 0x0073 PR_ORIGINAL_DISPLAY_CC
Definition: libpst.h:225
pst_entryid * sent_items_folder
mapi element 0x35e4
Definition: libpst.h:370
pst_string timezonestring
mapi element 0x8234
Definition: libpst.h:731
uint32_t bydaymask
bit mask of days of the week
Definition: libpst.h:697
pst_string outlook_received_name1
mapi element 0x0040 PR_RECEIVED_BY_NAME
Definition: libpst.h:331
struct pst_id2_tree pst_id2_tree
pst_string other_postal_code
mapi element 0x3a61 PR_OTHER_ADDRESS_POSTAL_CODE
Definition: libpst.h:554
int pst_load_index(pst_file *pf)
Load the index entries from the pst file.
pst_string suffix
mapi element 0x3a05 PR_GENERATION (Jr., Sr., III, etc)
Definition: libpst.h:580
struct pst_item_contact pst_item_contact
This contains the contact related mapi elements.
pst_string followup
mapi element 0x8530
Definition: libpst.h:475
int32_t alarm_minutes
mapi element 0x8501 PR_OUTLOOK_COMMON_REMINDER_MINUTES_BEFORE
Definition: libpst.h:727
pst_string work_address_city
mapi element 0x8046
Definition: libpst.h:594
This contains the folder related mapi elements.
Definition: libpst.h:343
char * pst_rfc2426_escape(char *str, char **result, size_t *resultlen)
Add any necessary escape characters for rfc2426 vcard format.
pst_string home_address
mapi element 0x801a
Definition: libpst.h:492
unsigned char encryption
Definition: libpst.h:932
FILETIME * wedding_anniversary
mapi element 0x3a41 PR_WEDDING_ANNIVERSARY
Definition: libpst.h:590
void pst_rfc2047(pst_item *item, pst_string *str, int needs_quote)
Convert str to rfc2047 encoding of str, possibly enclosed in quotes if it contains spaces...
pst_binary encrypted_htmlbody
mapi element 0x6f02
Definition: libpst.h:190
pst_item_appointment * appointment
calendar mapi elements
Definition: libpst.h:800
pst_string address2_transport
mapi element 0x8092
Definition: libpst.h:415
pst_desc_tree * d_tail
Definition: libpst.h:907
FILETIME * modify_date
mapi element 0x3008 PR_LAST_MODIFICATION_TIME
Definition: libpst.h:855
pst_item_contact * contact
contact mapi elements
Definition: libpst.h:790
pst_string comment
mapi element 0x3004 PR_COMMENT
Definition: libpst.h:829
int pst_reopen(pst_file *pf)
Reopen the pst file after a fork.
int32_t importance
mapi element 0x0017 PR_IMPORTANCE
Definition: libpst.h:199
pst_string billing_information
mapi element 0x8535
Definition: libpst.h:429
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
int32_t recurrence_type
mapi element 0x8231
Definition: libpst.h:765
uint32_t position
occurrence of day for 2nd Tuesday of month, in which case position is 2
Definition: libpst.h:703
int64_t offset
Definition: libpst.h:888
pst_string home_fax
mapi element 0x3a25 PR_HOME_FAX_NUMBER
Definition: libpst.h:498
uint32_t parm4
Definition: libpst.h:686
pst_string mobile_phone
mapi element 0x3a1c PR_MOBILE_TELEPHONE_NUMBER
Definition: libpst.h:534
int rich_text
mapi element 0x3a40 PR_SEND_RICH_INFO
Definition: libpst.h:576
struct pst_item_email pst_item_email
This contains the email related mapi elements.
pst_string car_phone
mapi element 0x3a1e PR_CAR_TELEPHONE_NUMBER
Definition: libpst.h:457
pst_string alarm_filename
mapi element 0x851f
Definition: libpst.h:729
pst_string hobbies
mapi element 0x3a43 PR_HOBBIES
Definition: libpst.h:490
pst_binary record_key
mapi element 0x0ff9 PR_RECORD_KEY
Definition: libpst.h:845
int subfolder
mapi element 0x360a PR_SUBFOLDERS
Definition: libpst.h:356
pst_string header
mapi element 0x007d PR_TRANSPORT_MESSAGE_HEADERS
Definition: libpst.h:192
struct pst_item_attach pst_item_attach
This contains the attachment related mapi elements.
pst_string transmittable_display_name
mapi element 0x3a20 PR_TRANSMITTABLE_DISPLAY_NAME
Definition: libpst.h:586
pst_string work_address_postofficebox
mapi element 0x804a
Definition: libpst.h:602
struct pst_desc_tree * child_tail
Definition: libpst.h:136
pst_string initials
mapi element 0x3a0a PR_INITIALS
Definition: libpst.h:512
int32_t original_sensitivity
mapi element 0x002e PR_ORIGINAL_SENSITIVITY
Definition: libpst.h:221
FILETIME * create_date
mapi element 0x3007 PR_CREATION_TIME
Definition: libpst.h:853
int32_t rtf_ws_trailing_count
mapi element 0x1011 PR_RTF_SYNC_TRAILING_COUNT, a count of the ignored characters after the last sign...
Definition: libpst.h:295
pst_string home_city
mapi element 0x3a59 PR_HOME_ADDRESS_CITY
Definition: libpst.h:494
pst_string business_homepage
mapi element 0x3a51 PR_BUSINESS_HOME_PAGE
Definition: libpst.h:441
uint32_t parm1
must be contiguous, not an array to make Python interface easier
Definition: libpst.h:683
pst_string address2a
mapi element 0x8095
Definition: libpst.h:411
pst_string other_country
mapi element 0x3a60 PR_OTHER_ADDRESS_COUNTRY
Definition: libpst.h:548
uint64_t index2_back
back pointer value in the first b-tree node in the descriptor tree
Definition: libpst.h:926
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_entryid * default_outbox_folder
mapi element 0x35e2
Definition: libpst.h:366
size_t pst_attach_to_file(pst_file *pf, pst_item_attach *attach, FILE *fp)
Write a binary attachment to a file.
pst_string processed_subject
mapi element 0x0070 PR_CONVERSATION_TOPIC
Definition: libpst.h:247
uint32_t termination
type of termination of the recurrence
Definition: libpst.h:693
uint64_t id2_val
only used if the attachment is by reference, in which case this is the id2 reference ...
Definition: libpst.h:620
pst_string computer_name
mapi element 0x3a49 PR_COMPUTER_NETWORK_NAME
Definition: libpst.h:463
int32_t internet_cpid
mapi element 0x3fde PR_INTERNET_CPID
Definition: libpst.h:837
struct pst_desc_tree * parent
Definition: libpst.h:134
pst_string telex
mapi element 0x3a2c PR_TELEX_NUMBER
Definition: libpst.h:584
pst_string address1_desc
mapi element 0x8084
Definition: libpst.h:405
uint64_t parent_d_id
Definition: libpst.h:128
int64_t u1
Definition: libpst.h:114
pst_string home_street
mapi element 0x3a5d PR_HOME_ADDRESS_STREET
Definition: libpst.h:510
int alarm
mapi element 0x8503 PR_OUTLOOK_COMMON_REMINDER_SET
Definition: libpst.h:723
struct pst_entryid pst_entryid
pst_string business_state
mapi element 0x3a28 PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE
Definition: libpst.h:451
char * ascii_type
mapi element 0x001a PR_MESSAGE_CLASS or 0x3613 PR_CONTAINER_CLASS
Definition: libpst.h:813
int rtf_in_sync
mapi element 0x0e1f PR_RTF_IN_SYNC, True means that the rtf version is same as text body...
Definition: libpst.h:289
void pst_convert_utf8(pst_item *item, pst_string *str)
Convert str to utf8 if possible; null strings are converted into empty strings.
char entryid[16]
Definition: libpst.h:104
pst_string work_address_street
mapi element 0x8045
Definition: libpst.h:592
struct pst_x_attrib_ll * next
link to next item in the list
Definition: libpst.h:881
pst_string business_po_box
mapi element 0x3a2b PR_BUSINESS_PO_BOX
Definition: libpst.h:447
pst_item_journal * journal
journal mapi elements
Definition: libpst.h:798
uint64_t offset
Definition: libpst.h:111
pst_string other_street
mapi element 0x3a63 PR_OTHER_ADDRESS_STREET
Definition: libpst.h:558
struct pst_item_message_store pst_item_message_store
This contains the message store related mapi elements.
pst_string company_main_phone
mapi element 0x3a57 PR_COMPANY_MAIN_PHONE_NUMBER
Definition: libpst.h:459
uint64_t block_id
block id that can be used to generate uid
Definition: libpst.h:784
pst_string address1_transport
mapi element 0x3002 PR_ADDRTYPE, or 0x8082
Definition: libpst.h:407
uint32_t map
key for the mapping
Definition: libpst.h:877
int pst_open(pst_file *pf, const char *name, const char *charset)
Open a pst file.
int16_t gender
mapi element 0x3a4d PR_GENDER
Definition: libpst.h:486
pst_string address3_transport
mapi element 0x80a2
Definition: libpst.h:423
unsigned char ind_type
index type or file type
Definition: libpst.h:938
pst_entryid * user_views_folder
mapi element 0x35e5
Definition: libpst.h:372
pst_string other_po_box
mapi element 0x3a64 PR_OTHER_ADDRESS_POST_OFFICE_BOX
Definition: libpst.h:552
pst_string primary_fax
mapi element 0x3a23 PR_PRIMARY_FAX_NUMBER
Definition: libpst.h:566
pst_string department
mapi element 0x3a18 PR_DEPARTMENT_NAME
Definition: libpst.h:469
pst_binary encrypted_body
mapi element 0x6f04
Definition: libpst.h:188
uint32_t mytype
Definition: libpst.h:875
struct pst_index_ll pst_index_ll
int32_t unseen_item_count
mapi element 0x3603 PR_CONTENT_UNREAD
Definition: libpst.h:347
pst_string recurrence_description
mapi element 0x8232 recurrence description
Definition: libpst.h:767
pst_string business_country
mapi element 0x3a26 PR_BUSINESS_ADDRESS_COUNTRY
Definition: libpst.h:437
uint32_t id
Definition: libpst.h:105
uint64_t d_id
Definition: libpst.h:127
pst_string surname
mapi element 0x3a11 PR_SURNAME
Definition: libpst.h:582
FILETIME * end
mapi element 0x8708
Definition: libpst.h:656
struct pst_item_extra_field * next
Definition: libpst.h:646
size_t size
Definition: libpst.h:154
int conversion_prohibited
mapi element 0x3a03 PR_CONVERSION_PROHIBITED
Definition: libpst.h:178
pst_string outlook_sender
mapi element 0x003b PR_SENT_REPRESENTING_SEARCH_KEY
Definition: libpst.h:235
FILETIME * recurrence_start
mapi element 0x8235 PR_OUTLOOK_EVENT_RECURRENCE_START
Definition: libpst.h:771
pst_string display_name_prefix
mapi element 0x3a45 PR_DISPLAY_NAME_PREFIX
Definition: libpst.h:471
struct pst_block_recorder pst_block_recorder
this is only used for internal debugging
pst_string sender2_access
mapi element 0x0c1e PR_SENDER_ADDRTYPE
Definition: libpst.h:301
struct pst_x_attrib_ll pst_x_attrib_ll
Linked list of extended attributes.
pst_string work_address_state
mapi element 0x8047
Definition: libpst.h:596
int32_t showas
mapi element 0x8205 PR_OUTLOOK_EVENT_SHOW_TIME_AS
Definition: libpst.h:737
pst_string language
mapi element 0x3a0c PR_LANGUAGE
Definition: libpst.h:520
pst_string company_name
mapi element 0x3a16 PR_COMPANY_NAME
Definition: libpst.h:461
size_t pst_attach_to_file_base64(pst_file *pf, pst_item_attach *attach, FILE *fp)
Write a binary attachment base64 encoded to a file.
pst_string location
mapi element 0x3a0d PR_LOCATION
Definition: libpst.h:522
FILETIME * reminder
mapi element 0x8560
Definition: libpst.h:725
This contains the common mapi elements, and pointers to structures for each major mapi item type...
Definition: libpst.h:780
int32_t method
mapi element 0x3705 PR_ATTACH_METHOD
Definition: libpst.h:633
pst_entryid * top_of_personal_folder
mapi element 0x35e0
Definition: libpst.h:364
pst_string profession
mapi element 0x3a46 PR_PROFESSION
Definition: libpst.h:570
int private_member
mapi element 0x002b PR_RECIPIENT_REASSIGNMENT_PROHIBITED
Definition: libpst.h:859
This contains the attachment related mapi elements.
Definition: libpst.h:608
pst_string def_postal_address
mapi element 0x3a15 PR_POSTAL_ADDRESS
Definition: libpst.h:467
Linked list of extended attributes.
Definition: libpst.h:871
pst_string reply_to
mapi element 0x0050 PR_REPLY_RECIPIENT_NAMES
Definition: libpst.h:265
uint32_t sub_type
implies number of recurrence parameters
Definition: libpst.h:681
char * cwd
original cwd when the file was opened
Definition: libpst.h:898
pst_string free_busy_address
mapi element 0x80d8
Definition: libpst.h:477
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 ttytdd_phone
mapi element 0x3a4b PR_TTYTDD_PHONE_NUMBER
Definition: libpst.h:588
pst_string report_text
mapi element 0x1001 PR_REPORT_TEXT, delivery report dsn body
Definition: libpst.h:317
pst_entryid * common_view_folder
mapi element 0x35e6
Definition: libpst.h:374
pst_string body_charset
derived from extra_fields["content-type"] if it contains a charset= subfield
Definition: libpst.h:831
pst_entryid * deleted_items_folder
mapi element 0x35e3
Definition: libpst.h:368
int message_cc_me
mapi element 0x0058 PR_MESSAGE_CC_ME, this user is listed explicitly in the CC address ...
Definition: libpst.h:205
pst_string nickname
mapi element 0x3a4f PR_NICKNAME
Definition: libpst.h:536
pst_string file_as
mapi element 0x3001 PR_DISPLAY_NAME
Definition: libpst.h:827
pst_string assistant_phone
mapi element 0x3a2e PR_ASSISTANT_TELEPHONE_NUMBER
Definition: libpst.h:427
int pst_close(pst_file *pf)
Close a pst file.
pst_string first_name
mapi element 0x3a06 PR_GIVEN_NAME
Definition: libpst.h:473
pst_string messageid
mapi element 0x1035
Definition: libpst.h:215
int32_t rtf_body_char_count
mapi element 0x1007 PR_RTF_SYNC_BODY_COUNT, a count of the significant characters in the rtf body...
Definition: libpst.h:271
uint32_t parm3
Definition: libpst.h:685
pst_string address2
mapi element 0x8093
Definition: libpst.h:409
pst_string outlook_sender_name2
mapi element 0x0c1a PR_SENDER_NAME
Definition: libpst.h:333
pst_recurrence * pst_convert_recurrence(pst_item_appointment *appt)
Decode raw recurrence data into a better structure.
pst_string outlook_search_key
mapi element 0x300b PR_SEARCH_KEY
Definition: libpst.h:337
uint32_t monthofyear
month of year for yearly recurrences
Definition: libpst.h:701
The string is either utf8 encoded, or it is in the code page specified by the containing mapi object...
Definition: libpst.h:144
pst_string business_fax
mapi element 0x3a24 PR_BUSINESS_FAX_NUMBER
Definition: libpst.h:439
size_t i_count
Definition: libpst.h:905
uint32_t type
Definition: libpst.h:674
int32_t ndr_reason_code
mapi element 0x0c04 PR_NDR_REASON_CODE
Definition: libpst.h:321
pst_string job_title
mapi element 0x3a17 PR_TITLE
Definition: libpst.h:516
pst_string recip2_address
mapi element 0x0078 PR_RCVD_REPRESENTING_EMAIL_ADDRESS
Definition: libpst.h:259
uint64_t i_id
Definition: libpst.h:110
int autoforward
mapi element 0x0002 PR_ALTERNATE_RECIPIENT_ALLOWED
Definition: libpst.h:168
struct pst_desc_tree * next
Definition: libpst.h:133
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
struct pst_id2_tree * child
Definition: libpst.h:121
This contains the message store related mapi elements.
Definition: libpst.h:362
pst_string mimetype
mapi element 0x370e PR_ATTACH_MIME_TAG
Definition: libpst.h:614
int32_t label
mapi element 0x8214
Definition: libpst.h:750
pst_binary predecessor_change
mapi element 0x65e3 PR_PREDECESSOR_CHANGE_LIST
Definition: libpst.h:847
struct pst_desc_tree * child
Definition: libpst.h:135
FILETIME * birthday
mapi element 0x3a42 PR_BIRTHDAY
Definition: libpst.h:431
struct pst_file pst_file
uint64_t inflated_size
Definition: libpst.h:113
int mail_permission
mapi element 0x3a0e PR_MAIL_PERMISSION
Definition: libpst.h:526
int32_t u1
Definition: libpst.h:103
pst_string keyword
mapi element 0x3a0b PR_KEYWORD
Definition: libpst.h:518
pst_string cc_address
mapi element 0x0e03 PR_DISPLAY_CC
Definition: libpst.h:170
size_t pst_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
fwrite with checking for null pointer.
struct pst_item pst_item
This contains the common mapi elements, and pointers to structures for each major mapi item type...
char * data
Definition: libpst.h:155
pst_index_ll * desc
Definition: libpst.h:129
pst_string ftp_site
mapi element 0x3a4c PR_FTP_SITE
Definition: libpst.h:479
uint32_t signature
0x30043004
Definition: libpst.h:669
pst_string sentto_address
mapi element 0x0e04 PR_DISPLAY_TO
Definition: libpst.h:315
pst_block_recorder * block_head
the head of the block recorder, a debug artifact used to detect cases where we might read the same bl...
Definition: libpst.h:913
int32_t rtf_ws_prefix_count
mapi element 0x1010 PR_RTF_SYNC_PREFIX_COUNT, a count of the ignored characters before the first sign...
Definition: libpst.h:292
uint64_t index1
file offset of the first b-tree node in the index tree
Definition: libpst.h:920
pst_index_ll * pst_getID(pst_file *pf, uint64_t i_id)
Lookup the i_id in the index linked list, and return a pointer to the element.
FILETIME * sent_date
mapi element 0x0039 PR_CLIENT_SUBMIT_TIME
Definition: libpst.h:311
pst_string other_phone
mapi element 0x3a1f PR_OTHER_TELEPHONE_NUMBER
Definition: libpst.h:550
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
uint32_t dayofmonth
day of month for monthly and yearly recurrences
Definition: libpst.h:699
int pst_stricmp(char *a, char *b)
compare strings case-insensitive.
int32_t assoc_count
mapi element 0x3617 PR_ASSOC_CONTENT_COUNT Associated content are items that are attached to this fol...
Definition: libpst.h:351
pst_string body
mapi element 0x1000 PR_BODY
Definition: libpst.h:833
pst_item_message_store * message_store
message store mapi elements
Definition: libpst.h:794
pst_string business_phone2
mapi element 0x3a1b PR_BUSINESS2_TELEPHONE_NUMBER
Definition: libpst.h:445
int32_t message_size
mapi element 0x0e08 PR_MESSAGE_SIZE
Definition: libpst.h:841
FILETIME * end
mapi element 0x820e PR_OUTLOOK_EVENT_START_END
Definition: libpst.h:717
this is only used for internal debugging
Definition: libpst.h:886
pst_string common_name
mapi element 0x3a0f PR_MHS_COMMON_NAME
Definition: libpst.h:540
int32_t no_child
Definition: libpst.h:131
uint32_t interval
recurrence interval in terms of the recurrence type
Definition: libpst.h:695
pst_string customer_id
mapi element 0x3a4a PR_CUSTOMER_ID
Definition: libpst.h:465
pst_entryid * top_of_folder
mapi element 0x7c07
Definition: libpst.h:378
pst_string manager_name
mapi element 0x3a4e PR_MANAGER_NAME
Definition: libpst.h:528
pst_string type
mapi element 0x8700
Definition: libpst.h:658
pst_string supplementary_info
mapi element 0x0c1b PR_SUPPLEMENTARY_INFO
Definition: libpst.h:325
pst_string org_id
mapi element 0x3a10 PR_ORGANIZATIONAL_ID_NUMBER
Definition: libpst.h:542
pst_string business_address
mapi element 0x801b
Definition: libpst.h:433
struct pst_item_journal pst_item_journal
This contains the journal related mapi elements.
FILETIME * arrival_date
mapi element 0x0e06 PR_MESSAGE_DELIVERY_TIME
Definition: libpst.h:163
const char * pst_default_charset(pst_item *item, int buflen, char *result)
Get the default character set for this item.
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
pst_string assistant_name
mapi element 0x3a30 PR_ASSISTANT
Definition: libpst.h:425
int32_t message_codepage
mapi element 0x3ffd PR_MESSAGE_CODEPAGE
Definition: libpst.h:839
struct pst_desc_tree pst_desc_tree
size_t i_capacity
Definition: libpst.h:905
int read_receipt
mapi element 0x0029 PR_READ_RECEIPT_REQUESTED
Definition: libpst.h:251
void pst_freeItem(pst_item *item)
Free the item returned by pst_parse_item().
pst_string callback_phone
mapi element 0x3a02 PR_CALLBACK_TELEPHONE_NUMBER
Definition: libpst.h:455
pst_item * pst_parse_item(pst_file *pf, pst_desc_tree *d_ptr, pst_id2_tree *m_head)
Assemble a mapi object from a descriptor pointer.
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
void * data
data target of the mapping, either uint32_t or string
Definition: libpst.h:879
pst_string address3
mapi element 0x80a3
Definition: libpst.h:417
uint64_t index2
file offset of the first b-tree node in the descriptor tree
Definition: libpst.h:924
pst_string outlook_version
mapi element 0x8554 PR_OUTLOOK_VERSION
Definition: libpst.h:843
struct pst_binary pst_binary
a simple wrapper for binary blobs
pst_x_attrib_ll * x_head
the head of the extended attributes linked list
Definition: libpst.h:909
pst_string home_po_box
mapi element 0x3a5e PR_HOME_ADDRESS_POST_OFFICE_BOX
Definition: libpst.h:504
pst_index_ll * assoc_tree
Definition: libpst.h:130
int is_recurring
mapi element 0x8223 PR_OUTLOOK_EVENT_IS_RECURRING
Definition: libpst.h:758
pst_string htmlbody
mapi element 0x1013
Definition: libpst.h:194
char * fname
original file name when the file was opened
Definition: libpst.h:900
int type
derived from mapi elements 0x001a PR_MESSAGE_CLASS or 0x3613 PR_CONTAINER_CLASS
Definition: libpst.h:811
int32_t pwd_chksum
mapi element 0x76ff
Definition: libpst.h:391
int32_t sequence
mapi element 0x3710 PR_ATTACH_MIME_SEQUENCE
Definition: libpst.h:637
int message_to_me
mapi element 0x0057 PR_MESSAGE_TO_ME, this user is listed explicitly in the TO address ...
Definition: libpst.h:213
uint32_t parm5
Definition: libpst.h:687
pst_string radio_phone
mapi element 0x3a1d PR_RADIO_TELEPHONE_NUMBER
Definition: libpst.h:572
size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t i_id, char **buf)
Get an ID block from the file using pst_ff_getIDblock() and decrypt if necessary. ...
This contains the appointment related mapi elements.
Definition: libpst.h:713
pst_item_extra_field * extra_fields
linked list of extra headers and such
Definition: libpst.h:796
int reply_requested
mapi element 0x0c17 PR_REPLY_REQUESTED
Definition: libpst.h:263
struct pst_block_recorder * next
Definition: libpst.h:887
pst_string home_country
mapi element 0x3a5a PR_HOME_ADDRESS_COUNTRY
Definition: libpst.h:496
pst_string address2_desc
mapi element 0x8094
Definition: libpst.h:413
pst_string home_phone
mapi element 0x3a09 PR_HOME_TELEPHONE_NUMBER
Definition: libpst.h:500
linked list of extra header fields
Definition: libpst.h:643
pst_entryid * search_root_folder
mapi element 0x35e7
Definition: libpst.h:376
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
uint64_t index1_back
back pointer value in the first b-tree node in the index tree
Definition: libpst.h:922
pst_binary recurrence_data
mapi element 0x8216 recurrence data
Definition: libpst.h:769
char * pst_rfc2445_datetime_format_now(int buflen, char *result)
Convert the current time rfc2445 date/time format 19531015T231000Z.
pst_string outlook_sender_name
mapi element 0x0042 PR_SENT_REPRESENTING_NAME
Definition: libpst.h:237
pst_string home_postal_code
mapi element 0x3a5b PR_HOME_ADDRESS_POSTAL_CODE
Definition: libpst.h:506
int is_utf8
Definition: libpst.h:147
uint64_t size
size of the pst file
Definition: libpst.h:928
pst_string sender2_address
mapi element 0x0c1f PR_SENDER_EMAIL_ADDRESS
Definition: libpst.h:303
pst_binary rtf_compressed
mapi element 0x1009 PR_RTF_COMPRESSED, the compressed rtf body data.
Definition: libpst.h:281
struct pst_string pst_string
The string is either utf8 encoded, or it is in the code page specified by the containing mapi object...
This contains the contact related mapi elements.
Definition: libpst.h:397
pst_string home_state
mapi element 0x3a5c PR_HOME_ADDRESS_STATE_OR_PROVINCE
Definition: libpst.h:508
This contains the email related mapi elements.
Definition: libpst.h:161
int32_t ndr_status_code
mapi element 0x0c20 PR_NDR_STATUS_CODE
Definition: libpst.h:327
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
struct pst_item_folder pst_item_folder
This contains the folder related mapi elements.
pst_string filename2
mapi element 0x3707 PR_ATTACH_LONG_FILENAME
Definition: libpst.h:612
FILETIME * report_time
mapi element 0x0032 PR_REPORT_TIME, delivery report time
Definition: libpst.h:319
pst_string description
mapi element 0x8712
Definition: libpst.h:660
FILETIME * recurrence_end
mapi element 0x8236 PR_OUTLOOK_EVENT_RECURRENCE_END
Definition: libpst.h:773
pst_string business_city
mapi element 0x3a27 PR_BUSINESS_ADDRESS_CITY
Definition: libpst.h:435
This contains the journal related mapi elements.
Definition: libpst.h:652
int message_recip_me
mapi element 0x0059 PR_MESSAGE_RECIP_ME, this user appears in TO, CC or BCC address list ...
Definition: libpst.h:209
pst_string pager_phone
mapi element 0x3a21 PR_PAGER_TELEPHONE_NUMBER
Definition: libpst.h:560
pst_string business_phone
mapi element 0x3a08 PR_BUSINESS_TELEPHONE_NUMBER
Definition: libpst.h:443
void pst_free_recurrence(pst_recurrence *r)
Free a recurrence structure.
pst_string isdn_phone
mapi element 0x3a2d PR_ISDN_NUMBER
Definition: libpst.h:514
const char * charset
default character set for items without one
Definition: libpst.h:902
char * pst_rfc2425_datetime_format(const FILETIME *ft, int buflen, char *result)
Convert a FILETIME into rfc2425 date/time format 1953-10-15T23:10:00Z which is the same as one of the...
pst_string office_loc
mapi element 0x3a19 PR_OFFICE_LOCATION
Definition: libpst.h:538
pst_desc_tree * d_head
the head and tail of the top level of the descriptor tree
Definition: libpst.h:907
pst_string recip_address
mapi element 0x0076 PR_RECEIVED_BY_EMAIL_ADDRESS
Definition: libpst.h:255
int pst_load_extended_attributes(pst_file *pf)
Load the extended attribute mapping table from the pst file.
pst_index_ll * id
Definition: libpst.h:120
uint32_t parm2
Definition: libpst.h:684
pst_string primary_phone
mapi element 0x3a1a PR_PRIMARY_TELEPHONE_NUMBER
Definition: libpst.h:568
pst_string gov_id
mapi element 0x3a07 PR_GOVERNMENT_ID_NUMBER
Definition: libpst.h:488
struct pst_id2_tree * next
Definition: libpst.h:122
int32_t ndr_diag_code
mapi element 0x0c05 PR_NDR_DIAG_CODE
Definition: libpst.h:323
pst_string other_address
mapi element 0x801c
Definition: libpst.h:544
pst_item_email * email
email mapi elements
Definition: libpst.h:786
char * pst_rfc2445_datetime_format(const FILETIME *ft, int buflen, char *result)
Convert a FILETIME into rfc2445 date/time format 19531015T231000Z.
int response_requested
mapi element 0x0063 PR_RESPONSE_REQUESTED
Definition: libpst.h:851
pst_string personal_homepage
mapi element 0x3a50 PR_PERSONAL_HOME_PAGE
Definition: libpst.h:562
pst_string mileage
mapi element 0x8534
Definition: libpst.h:532
pst_entryid * sentmail_folder
mapi element 0x0e0a PR_SENTMAIL_ENTRYID
Definition: libpst.h:313
pst_string work_address_postalcode
mapi element 0x8048
Definition: libpst.h:598
int32_t sensitivity
mapi element 0x0036 PR_SENSITIVITY
Definition: libpst.h:309
pst_string fullname
mapi element 0x8005
Definition: libpst.h:481
pst_desc_tree * pst_getTopOfFolders(pst_file *pf, const pst_item *root)
Get the top of folders descriptor tree.
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 pref_name
mapi element 0x3a47 PR_PREFERRED_BY_NAME
Definition: libpst.h:564
pst_string recip2_access
mapi element 0x0077 PR_RCVD_REPRESENTING_ADDRTYPE
Definition: libpst.h:257
FILETIME * start
mapi element 0x820d PR_OUTLOOK_EVENT_START_DATE
Definition: libpst.h:715
void pst_convert_utf8_null(pst_item *item, pst_string *str)
Convert str to utf8 if possible; null strings are preserved.
pst_string original_to
mapi element 0x0074 PR_ORIGINAL_DISPLAY_TO
Definition: libpst.h:227
struct pst_item_appointment pst_item_appointment
This contains the appointment related mapi elements.
uint64_t id2
Definition: libpst.h:119
FILE * fp
file pointer to opened PST file
Definition: libpst.h:896
pst_string work_address_country
mapi element 0x8049
Definition: libpst.h:600
pst_string business_street
mapi element 0x3a29 PR_BUSINESS_ADDRESS_STREET
Definition: libpst.h:453
struct pst_item_attach * next
Definition: libpst.h:638
int32_t position
mapi element 0x370b PR_RENDERING_POSITION
Definition: libpst.h:635
uint32_t count
number of occurrences, even if recurrence terminates based on date
Definition: libpst.h:705
pst_string spouse_name
mapi element 0x3a48 PR_SPOUSE_NAME
Definition: libpst.h:578
uint64_t size
Definition: libpst.h:112
pst_string business_postal_code
mapi element 0x3a2a PR_BUSINESS_POSTAL_CODE
Definition: libpst.h:449
int do_read64
Definition: libpst.h:918
pst_binary pst_attach_to_mem(pst_file *pf, pst_item_attach *attach)
Assemble the binary attachment into a single buffer.
pst_string other_state
mapi element 0x3a62 PR_OTHER_ADDRESS_STATE_OR_PROVINCE
Definition: libpst.h:556
pst_string rtf_body_tag
mapi element 0x1008 PR_RTF_SYNC_BODY_TAG, the first couple of lines of RTF body so that after modific...
Definition: libpst.h:277
void pst_rfc2231(pst_string *str)
Convert str to rfc2231 encoding of str.
pst_string middle_name
mapi element 0x3a44 PR_MIDDLE_NAME
Definition: libpst.h:530
struct pst_desc_tree * prev
Definition: libpst.h:132
pst_item_folder * folder
folder mapi elements
Definition: libpst.h:788
int32_t rtf_body_crc
mapi element 0x1006 PR_RTF_SYNC_BODY_CRC
Definition: libpst.h:273
pst_string address3_desc
mapi element 0x80a4
Definition: libpst.h:421
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
pst_string other_city
mapi element 0x3a5f PR_OTHER_ADDRESS_CITY
Definition: libpst.h:546
char * str
Definition: libpst.h:148
pst_desc_tree * pst_getNextDptr(pst_desc_tree *d)
Walk the descriptor tree.
pst_id2_tree * id2_head
id2 tree needed to resolve attachments by reference
Definition: libpst.h:624
FILETIME * start
mapi element 0x8706
Definition: libpst.h:654
struct pst_item_extra_field pst_item_extra_field
linked list of extra header fields
struct pst_recurrence pst_recurrence
This contains the recurrence data separated into fields.
int32_t item_count
mapi element 0x3602 PR_CONTENT_COUNT
Definition: libpst.h:345
pst_string address1a
mapi element 0x8085
Definition: libpst.h:403
pst_string address3a
mapi element 0x80a5
Definition: libpst.h:419
This contains the recurrence data separated into fields.
Definition: libpst.h:667
int all_day
mapi element 0x8215 PR_OUTLOOK_EVENT_ALL_DAY
Definition: libpst.h:754
pst_index_ll * i_table
the array of index structures
Definition: libpst.h:904
struct pst_file * pf
pointer to the pst_file
Definition: libpst.h:782
pst_string home_phone2
mapi element 0x3a2f PR_HOME2_TELEPHONE_NUMBER
Definition: libpst.h:502
pst_string location
mapi element 0x8208 PR_OUTLOOK_EVENT_LOCATION
Definition: libpst.h:719
pst_string account_name
mapi element 0x3a00 PR_ACCOUNT
Definition: libpst.h:399
pst_string content_id
mapi element 0x3712 PR_ATTACH_CONTENT_ID
Definition: libpst.h:616