comparison src/libpst.c @ 151:cda7c812ec01

track character set individually for each mapi element
author Carl Byington <carl@five-ten-sg.com>
date Sun, 08 Mar 2009 14:35:26 -0700
parents 06aa84023b48
children edebaf0e87d2
comparison
equal deleted inserted replaced
150:06aa84023b48 151:cda7c812ec01
1113 } 1113 }
1114 pst_free_list(list); 1114 pst_free_list(list);
1115 1115
1116 if ((id2_ptr = pst_getID2(id2_head, (uint64_t)0x692))) { 1116 if ((id2_ptr = pst_getID2(id2_head, (uint64_t)0x692))) {
1117 // DSN/MDN reports? 1117 // DSN/MDN reports?
1118 DEBUG_EMAIL(("DSN/MDN processing \n")); 1118 DEBUG_EMAIL(("DSN/MDN processing\n"));
1119 list = pst_parse_block(pf, id2_ptr->id->id, id2_head, NULL); 1119 list = pst_parse_block(pf, id2_ptr->id->id, id2_head, NULL);
1120 if (!list) { 1120 if (!list) {
1121 DEBUG_WARN(("ERROR error processing main DSN/MDN record\n")); 1121 DEBUG_WARN(("ERROR error processing main DSN/MDN record\n"));
1122 if (!m_head) pst_free_id2(id2_head); 1122 if (!m_head) pst_free_id2(id2_head);
1123 DEBUG_RET(); 1123 DEBUG_RET();
1139 } 1139 }
1140 pst_free_list(list); 1140 pst_free_list(list);
1141 } 1141 }
1142 1142
1143 if ((id2_ptr = pst_getID2(id2_head, (uint64_t)0x671))) { 1143 if ((id2_ptr = pst_getID2(id2_head, (uint64_t)0x671))) {
1144 // should not have any existing attachments anyway
1145 //while (item->attach) {
1146 // DEBUG_EMAIL(("throw away existing attachment\n"));
1147 // attach = item->attach->next;
1148 // free(item->attach);
1149 // item->attach = attach;
1150 //}
1151
1152 DEBUG_EMAIL(("ATTACHMENT processing attachment\n")); 1144 DEBUG_EMAIL(("ATTACHMENT processing attachment\n"));
1153 list = pst_parse_block(pf, id2_ptr->id->id, id2_head, NULL); 1145 list = pst_parse_block(pf, id2_ptr->id->id, id2_head, NULL);
1154 if (!list) { 1146 if (!list) {
1155 DEBUG_WARN(("ERROR error processing main attachment record\n")); 1147 DEBUG_WARN(("ERROR error processing main attachment record\n"));
1156 if (!m_head) pst_free_id2(id2_head); 1148 if (!m_head) pst_free_id2(id2_head);
1716 } 1708 }
1717 1709
1718 1710
1719 // This version of free does NULL check first 1711 // This version of free does NULL check first
1720 #define SAFE_FREE(x) {if (x) free(x);} 1712 #define SAFE_FREE(x) {if (x) free(x);}
1721 1713 #define SAFE_FREE_STR(x) SAFE_FREE(x.str)
1722 1714
1723 // check if item->email is NULL, and init if so 1715 // check if item->email is NULL, and init if so
1724 #define MALLOC_EMAIL(x) { if (!x->email) { x->email = (pst_item_email*) xmalloc(sizeof(pst_item_email)); memset(x->email, 0, sizeof(pst_item_email) );} } 1716 #define MALLOC_EMAIL(x) { if (!x->email) { x->email = (pst_item_email*) xmalloc(sizeof(pst_item_email)); memset(x->email, 0, sizeof(pst_item_email) );} }
1725 #define MALLOC_FOLDER(x) { if (!x->folder) { x->folder = (pst_item_folder*) xmalloc(sizeof(pst_item_folder)); memset(x->folder, 0, sizeof(pst_item_folder) );} } 1717 #define MALLOC_FOLDER(x) { if (!x->folder) { x->folder = (pst_item_folder*) xmalloc(sizeof(pst_item_folder)); memset(x->folder, 0, sizeof(pst_item_folder) );} }
1726 #define MALLOC_CONTACT(x) { if (!x->contact) { x->contact = (pst_item_contact*) xmalloc(sizeof(pst_item_contact)); memset(x->contact, 0, sizeof(pst_item_contact) );} } 1718 #define MALLOC_CONTACT(x) { if (!x->contact) { x->contact = (pst_item_contact*) xmalloc(sizeof(pst_item_contact)); memset(x->contact, 0, sizeof(pst_item_contact) );} }
1727 #define MALLOC_MESSAGESTORE(x) { if (!x->message_store) { x->message_store = (pst_item_message_store*) xmalloc(sizeof(pst_item_message_store)); memset(x->message_store, 0, sizeof(pst_item_message_store));} } 1719 #define MALLOC_MESSAGESTORE(x) { if (!x->message_store) { x->message_store = (pst_item_message_store*) xmalloc(sizeof(pst_item_message_store)); memset(x->message_store, 0, sizeof(pst_item_message_store));} }
1728 #define MALLOC_JOURNAL(x) { if (!x->journal) { x->journal = (pst_item_journal*) xmalloc(sizeof(pst_item_journal)); memset(x->journal, 0, sizeof(pst_item_journal) );} } 1720 #define MALLOC_JOURNAL(x) { if (!x->journal) { x->journal = (pst_item_journal*) xmalloc(sizeof(pst_item_journal)); memset(x->journal, 0, sizeof(pst_item_journal) );} }
1729 #define MALLOC_APPOINTMENT(x) { if (!x->appointment) { x->appointment = (pst_item_appointment*) xmalloc(sizeof(pst_item_appointment)); memset(x->appointment, 0, sizeof(pst_item_appointment) );} } 1721 #define MALLOC_APPOINTMENT(x) { if (!x->appointment) { x->appointment = (pst_item_appointment*) xmalloc(sizeof(pst_item_appointment)); memset(x->appointment, 0, sizeof(pst_item_appointment) );} }
1722
1730 // malloc space and copy the current item's data null terminated 1723 // malloc space and copy the current item's data null terminated
1731 #define LIST_COPY(targ, type) { \ 1724 #define LIST_COPY(targ, type) { \
1732 targ = type realloc(targ, list->items[x]->size+1); \ 1725 targ = type realloc(targ, list->items[x]->size+1); \
1733 memcpy(targ, list->items[x]->data, list->items[x]->size); \ 1726 memcpy(targ, list->items[x]->data, list->items[x]->size); \
1734 memset(((char*)targ)+list->items[x]->size, 0, (size_t)1); \ 1727 memset(((char*)targ)+list->items[x]->size, 0, (size_t)1); \
1735 } 1728 }
1729
1730 #define LIST_COPY_BOOL(label, targ) { \
1731 if (*(int16_t*)list->items[x]->data) { \
1732 DEBUG_EMAIL((label" - True\n")); \
1733 targ = 1; \
1734 } else { \
1735 DEBUG_EMAIL((label" - False\n")); \
1736 targ = 0; \
1737 } \
1738 }
1739
1740 #define LIST_COPY_EMAIL_BOOL(label, targ) { \
1741 MALLOC_EMAIL(item); \
1742 LIST_COPY_BOOL(label, targ) \
1743 }
1744
1745 #define LIST_COPY_CONTACT_BOOL(label, targ) { \
1746 MALLOC_CONTACT(item); \
1747 LIST_COPY_BOOL(label, targ) \
1748 }
1749
1750 #define LIST_COPY_APPT_BOOL(label, targ) { \
1751 MALLOC_APPOINTMENT(item); \
1752 LIST_COPY_BOOL(label, targ) \
1753 }
1754
1755 // malloc space and copy the current item's data null terminated
1756 // including the utf8 flag
1757 #define LIST_COPY_STR(label, targ) { \
1758 LIST_COPY(targ.str, (char*)); \
1759 targ.is_utf8 = (list->items[x]->type == 0x1f) ? 1 : 0; \
1760 DEBUG_EMAIL((label" - unicode %d - %s\n", targ.is_utf8, targ.str)); \
1761 }
1762
1763 #define LIST_COPY_EMAIL_STR(label, targ) { \
1764 MALLOC_EMAIL(item); \
1765 LIST_COPY_STR(label, targ); \
1766 }
1767
1768 #define LIST_COPY_CONTACT_STR(label, targ) { \
1769 MALLOC_CONTACT(item); \
1770 LIST_COPY_STR(label, targ); \
1771 }
1772
1773 #define LIST_COPY_APPT_STR(label, targ) { \
1774 MALLOC_APPOINTMENT(item); \
1775 LIST_COPY_STR(label, targ); \
1776 }
1777
1736 // malloc space and copy the item filetime 1778 // malloc space and copy the item filetime
1737 #define LIST_COPY_TIME(targ) { \ 1779 #define LIST_COPY_TIME(targ) { \
1738 targ = (FILETIME*) realloc(targ, sizeof(FILETIME)); \ 1780 targ = (FILETIME*) realloc(targ, sizeof(FILETIME)); \
1739 memcpy(targ, list->items[x]->data, list->items[x]->size); \ 1781 memcpy(targ, list->items[x]->data, list->items[x]->size); \
1740 LE32_CPU(targ->dwLowDateTime); \ 1782 LE32_CPU(targ->dwLowDateTime); \
1741 LE32_CPU(targ->dwHighDateTime); \ 1783 LE32_CPU(targ->dwHighDateTime); \
1742 } 1784 }
1785
1743 // malloc space and copy the current item's data and size 1786 // malloc space and copy the current item's data and size
1744 #define LIST_COPY_SIZE(targ, type, mysize) { \ 1787 #define LIST_COPY_SIZE(targ, type, mysize) { \
1745 mysize = list->items[x]->size; \ 1788 mysize = list->items[x]->size; \
1746 if (mysize) { \ 1789 if (mysize) { \
1747 targ = type realloc(targ, mysize); \ 1790 targ = type realloc(targ, mysize); \
1777 DEBUG_RET(); 1820 DEBUG_RET();
1778 return -1; 1821 return -1;
1779 } 1822 }
1780 1823
1781 while (list) { 1824 while (list) {
1782 int32_t x = 0; 1825 int32_t x;
1783 while (x < list->count_item) { 1826 for (x=0; x<list->count_item; x++) {
1784 int32_t t; 1827 int32_t t;
1785 pst_item_extra_field *ef; 1828 pst_item_extra_field *ef;
1786 // check here to see if the id is one that is mapped. 1829 // check here to see if the id is one that is mapped.
1787 DEBUG_EMAIL(("#%d - id: %#x type: %#x length: %#x\n", x, list->items[x]->id, list->items[x]->type, list->items[x]->size)); 1830 DEBUG_EMAIL(("#%d - id: %#x type: %#x length: %#x\n", x, list->items[x]->id, list->items[x]->type, list->items[x]->size));
1788 1831
1789 switch (list->items[x]->id) { 1832 switch (list->items[x]->id) {
1790 case PST_ATTRIB_HEADER: // CUSTOM attribute for saying the Extra Headers 1833 case PST_ATTRIB_HEADER: // CUSTOM attribute for saying the Extra Headers
1791 DEBUG_EMAIL(("Extra Field - "));
1792 if (list->items[x]->extra) { 1834 if (list->items[x]->extra) {
1793 ef = (pst_item_extra_field*) xmalloc(sizeof(pst_item_extra_field)); 1835 ef = (pst_item_extra_field*) xmalloc(sizeof(pst_item_extra_field));
1794 memset(ef, 0, sizeof(pst_item_extra_field)); 1836 memset(ef, 0, sizeof(pst_item_extra_field));
1795 ef->field_name = (char*) xmalloc(strlen(list->items[x]->extra)+1); 1837 ef->field_name = (char*) xmalloc(strlen(list->items[x]->extra)+1);
1796 strcpy(ef->field_name, list->items[x]->extra); 1838 strcpy(ef->field_name, list->items[x]->extra);
1797 LIST_COPY(ef->value, (char*)); 1839 LIST_COPY(ef->value, (char*));
1798 ef->next = item->extra_fields; 1840 ef->next = item->extra_fields;
1799 item->extra_fields = ef; 1841 item->extra_fields = ef;
1800 DEBUG_EMAIL(("\"%s\" = \"%s\"\n", ef->field_name, ef->value)); 1842 DEBUG_EMAIL(("Extra Field - \"%s\" = \"%s\"\n", ef->field_name, ef->value));
1801 if (strcmp(ef->field_name, "content-type") == 0) { 1843 if (strcmp(ef->field_name, "content-type") == 0) {
1802 char *p = strstr(ef->value, "charset=\""); 1844 char *p = strstr(ef->value, "charset=\"");
1803 if (p) { 1845 if (p) {
1804 p += 9; // skip over charset=" 1846 p += 9; // skip over charset="
1805 char *pp = strchr(p, '"'); 1847 char *pp = strchr(p, '"');
1806 if (pp) { 1848 if (pp) {
1807 *pp = '\0'; 1849 *pp = '\0';
1808 char *set = strdup(p); 1850 char *set = strdup(p);
1809 *pp = '"'; 1851 *pp = '"';
1810 if (item->body_charset) free(item->body_charset); 1852 if (item->body_charset.str) free(item->body_charset.str);
1811 item->body_charset = set; 1853 item->body_charset.str = set;
1854 item->body_charset.is_utf8 = 1;
1812 DEBUG_EMAIL(("body charset %s from content-type extra field\n", set)); 1855 DEBUG_EMAIL(("body charset %s from content-type extra field\n", set));
1813 } 1856 }
1814 } 1857 }
1815 } 1858 }
1816 } 1859 }
1818 DEBUG_EMAIL(("NULL extra field\n")); 1861 DEBUG_EMAIL(("NULL extra field\n"));
1819 } 1862 }
1820 break; 1863 break;
1821 case 0x0002: // PR_ALTERNATE_RECIPIENT_ALLOWED 1864 case 0x0002: // PR_ALTERNATE_RECIPIENT_ALLOWED
1822 // If set to true, the sender allows this email to be autoforwarded 1865 // If set to true, the sender allows this email to be autoforwarded
1823 DEBUG_EMAIL(("AutoForward allowed - ")); 1866 LIST_COPY_EMAIL_BOOL("AutoForward allowed", item->email->autoforward);
1824 MALLOC_EMAIL(item); 1867 if (!item->email->autoforward) item->email->autoforward = -1;
1825 if (*(int16_t*)list->items[x]->data) {
1826 DEBUG_EMAIL(("True\n"));
1827 item->email->autoforward = 1;
1828 } else {
1829 DEBUG_EMAIL(("False\n"));
1830 item->email->autoforward = -1;
1831 }
1832 break; 1868 break;
1833 case 0x0003: // Extended Attributes table 1869 case 0x0003: // Extended Attributes table
1834 DEBUG_EMAIL(("Extended Attributes Table - NOT PROCESSED\n")); 1870 DEBUG_EMAIL(("Extended Attributes Table - NOT PROCESSED\n"));
1835 break; 1871 break;
1836 case 0x0017: // PR_IMPORTANCE 1872 case 0x0017: // PR_IMPORTANCE
1837 // How important the sender deems it to be 1873 // How important the sender deems it to be
1838 // 0 - Low 1874 // 0 - Low
1839 // 1 - Normal 1875 // 1 - Normal
1840 // 2 - High 1876 // 2 - High
1841 DEBUG_EMAIL(("Importance Level - "));
1842 MALLOC_EMAIL(item); 1877 MALLOC_EMAIL(item);
1843 memcpy(&(item->email->importance), list->items[x]->data, sizeof(item->email->importance)); 1878 memcpy(&(item->email->importance), list->items[x]->data, sizeof(item->email->importance));
1844 LE32_CPU(item->email->importance); 1879 LE32_CPU(item->email->importance);
1845 t = item->email->importance; 1880 t = item->email->importance;
1846 DEBUG_EMAIL(("%s [%i]\n", ((int)t==0?"Low": 1881 DEBUG_EMAIL(("Importance Level - %s [%i]\n", ((int)t==0?"Low" :
1847 ((int)t==1?"Normal": 1882 ((int)t==1?"Normal" :
1848 "High")), t)); 1883 "High")), t));
1849 break; 1884 break;
1850 case 0x001A: // PR_MESSAGE_CLASS Ascii type of messages - NOT FOLDERS 1885 case 0x001A: // PR_MESSAGE_CLASS Ascii type of messages - NOT FOLDERS
1851 // must be case insensitive 1886 // must be case insensitive
1852 DEBUG_EMAIL(("IPM.x - "));
1853 LIST_COPY(item->ascii_type, (char*)); 1887 LIST_COPY(item->ascii_type, (char*));
1854 if (pst_strincmp("IPM.Note", item->ascii_type, 8) == 0) 1888 if (pst_strincmp("IPM.Note", item->ascii_type, 8) == 0)
1855 // the string begins with IPM.Note... 1889 // the string begins with IPM.Note...
1856 item->type = PST_TYPE_NOTE; 1890 item->type = PST_TYPE_NOTE;
1857 else if (pst_stricmp("IPM", item->ascii_type) == 0) 1891 else if (pst_stricmp("IPM", item->ascii_type) == 0)
1870 else if (pst_strincmp("IPM.Task", item->ascii_type, 8) == 0) 1904 else if (pst_strincmp("IPM.Task", item->ascii_type, 8) == 0)
1871 item->type = PST_TYPE_TASK; 1905 item->type = PST_TYPE_TASK;
1872 else 1906 else
1873 item->type = PST_TYPE_OTHER; 1907 item->type = PST_TYPE_OTHER;
1874 1908
1875 DEBUG_EMAIL(("%s\n", item->ascii_type)); 1909 DEBUG_EMAIL(("IPM.x - %s\n", item->ascii_type));
1876 break; 1910 break;
1877 case 0x0023: // PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED 1911 case 0x0023: // PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED
1878 // set if the sender wants a delivery report from all recipients 1912 // set if the sender wants a delivery report from all recipients
1879 DEBUG_EMAIL(("Global Delivery Report - ")); 1913 LIST_COPY_EMAIL_BOOL("Global Delivery Report", item->email->delivery_report);
1880 MALLOC_EMAIL(item);
1881 if (*(int16_t*)list->items[x]->data) {
1882 DEBUG_EMAIL(("True\n"));
1883 item->email->delivery_report = 1;
1884 } else {
1885 DEBUG_EMAIL(("False\n"));
1886 item->email->delivery_report = 0;
1887 }
1888 break; 1914 break;
1889 case 0x0026: // PR_PRIORITY 1915 case 0x0026: // PR_PRIORITY
1890 // Priority of a message 1916 // Priority of a message
1891 // -1 NonUrgent 1917 // -1 NonUrgent
1892 // 0 Normal 1918 // 0 Normal
1893 // 1 Urgent 1919 // 1 Urgent
1894 DEBUG_EMAIL(("Priority - "));
1895 MALLOC_EMAIL(item); 1920 MALLOC_EMAIL(item);
1896 memcpy(&(item->email->priority), list->items[x]->data, sizeof(item->email->priority)); 1921 memcpy(&(item->email->priority), list->items[x]->data, sizeof(item->email->priority));
1897 LE32_CPU(item->email->priority); 1922 LE32_CPU(item->email->priority);
1898 t = item->email->priority; 1923 t = item->email->priority;
1899 DEBUG_EMAIL(("%s [%i]\n", (t<0?"NonUrgent":(t==0?"Normal":"Urgent")), t)); 1924 DEBUG_EMAIL(("Priority - %s [%i]\n", (t<0?"NonUrgent":(t==0?"Normal":"Urgent")), t));
1900 break; 1925 break;
1901 case 0x0029: // PR_READ_RECEIPT_REQUESTED 1926 case 0x0029: // PR_READ_RECEIPT_REQUESTED
1902 DEBUG_EMAIL(("Read Receipt - ")); 1927 LIST_COPY_EMAIL_BOOL("Read Receipt", item->email->read_receipt);
1903 MALLOC_EMAIL(item);
1904 if (*(int16_t*)list->items[x]->data) {
1905 DEBUG_EMAIL(("True\n"));
1906 item->email->read_receipt = 1;
1907 } else {
1908 DEBUG_EMAIL(("False\n"));
1909 item->email->read_receipt = 0;
1910 }
1911 break; 1928 break;
1912 case 0x002B: // PR_RECIPIENT_REASSIGNMENT_PROHIBITED 1929 case 0x002B: // PR_RECIPIENT_REASSIGNMENT_PROHIBITED
1913 DEBUG_EMAIL(("Reassignment Prohibited (Private) - ")); 1930 LIST_COPY_BOOL("Reassignment Prohibited (Private)", item->private_member);
1914 if (*(int16_t*)list->items[x]->data) {
1915 DEBUG_EMAIL(("True\n"));
1916 item->private_member = 1;
1917 } else {
1918 DEBUG_EMAIL(("False\n"));
1919 item->private_member = 0;
1920 }
1921 break; 1931 break;
1922 case 0x002E: // PR_ORIGINAL_SENSITIVITY 1932 case 0x002E: // PR_ORIGINAL_SENSITIVITY
1923 // the sensitivity of the message before being replied to or forwarded 1933 // the sensitivity of the message before being replied to or forwarded
1924 // 0 - None 1934 // 0 - None
1925 // 1 - Personal 1935 // 1 - Personal
1926 // 2 - Private 1936 // 2 - Private
1927 // 3 - Company Confidential 1937 // 3 - Company Confidential
1928 DEBUG_EMAIL(("Original Sensitivity - "));
1929 MALLOC_EMAIL(item); 1938 MALLOC_EMAIL(item);
1930 memcpy(&(item->email->orig_sensitivity), list->items[x]->data, sizeof(item->email->orig_sensitivity)); 1939 memcpy(&(item->email->orig_sensitivity), list->items[x]->data, sizeof(item->email->orig_sensitivity));
1931 LE32_CPU(item->email->orig_sensitivity); 1940 LE32_CPU(item->email->orig_sensitivity);
1932 t = item->email->orig_sensitivity; 1941 t = item->email->orig_sensitivity;
1933 DEBUG_EMAIL(("%s [%i]\n", ((int)t==0?"None": 1942 DEBUG_EMAIL(("Original Sensitivity - %s [%i]\n", ((int)t==0?"None" :
1934 ((int)t==1?"Personal": 1943 ((int)t==1?"Personal" :
1935 ((int)t==2?"Private": 1944 ((int)t==2?"Private" :
1936 "Company Confidential"))), t)); 1945 "Company Confidential"))), t));
1937 break; 1946 break;
1938 case 0x0032: // PR_REPORT_TIME 1947 case 0x0032: // PR_REPORT_TIME
1939 DEBUG_EMAIL(("Report time - "));
1940 MALLOC_EMAIL(item); 1948 MALLOC_EMAIL(item);
1941 LIST_COPY_TIME(item->email->report_time); 1949 LIST_COPY_TIME(item->email->report_time);
1942 DEBUG_EMAIL(("%s", fileTimeToAscii(item->email->report_time))); 1950 DEBUG_EMAIL(("Report time - %s\n", fileTimeToAscii(item->email->report_time)));
1943 break; 1951 break;
1944 case 0x0036: // PR_SENSITIVITY 1952 case 0x0036: // PR_SENSITIVITY
1945 // sender's opinion of the sensitivity of an email 1953 // sender's opinion of the sensitivity of an email
1946 // 0 - None 1954 // 0 - None
1947 // 1 - Personal 1955 // 1 - Personal
1948 // 2 - Private 1956 // 2 - Private
1949 // 3 - Company Confidential 1957 // 3 - Company Confidential
1950 DEBUG_EMAIL(("Sensitivity - "));
1951 MALLOC_EMAIL(item); 1958 MALLOC_EMAIL(item);
1952 memcpy(&(item->email->sensitivity), list->items[x]->data, sizeof(item->email->sensitivity)); 1959 memcpy(&(item->email->sensitivity), list->items[x]->data, sizeof(item->email->sensitivity));
1953 LE32_CPU(item->email->sensitivity); 1960 LE32_CPU(item->email->sensitivity);
1954 t = item->email->sensitivity; 1961 t = item->email->sensitivity;
1955 DEBUG_EMAIL(("%s [%i]\n", ((int)t==0?"None": 1962 DEBUG_EMAIL(("Sensitivity - %s [%i]\n", ((int)t==0?"None" :
1956 ((int)t==1?"Personal": 1963 ((int)t==1?"Personal" :
1957 ((int)t==2?"Private": 1964 ((int)t==2?"Private" :
1958 "Company Confidential"))), t)); 1965 "Company Confidential"))), t));
1959 break; 1966 break;
1960 case 0x0037: // PR_SUBJECT raw subject 1967 case 0x0037: // PR_SUBJECT raw subject
1961 DEBUG_EMAIL(("Raw Subject - ")); 1968 {
1962 MALLOC_EMAIL(item); 1969 int off = 0;
1963 item->email->subject = (pst_item_email_subject*) realloc(item->email->subject, sizeof(pst_item_email_subject)); 1970 if ((list->items[x]->size > 2) && (((uint8_t)list->items[x]->data[0]) < 0x20)) {
1964 memset(item->email->subject, 0, sizeof(pst_item_email_subject)); 1971 off = 2;
1965 DEBUG_EMAIL((" [size = %i] ", list->items[x]->size));
1966 if (list->items[x]->size > 0) {
1967 if (isprint(list->items[x]->data[0]) || (list->items[x]->size < 2)) {
1968 // then there are no control bytes at the front
1969 item->email->subject->off1 = 0;
1970 item->email->subject->off2 = 0;
1971 item->email->subject->subj = realloc(item->email->subject->subj, list->items[x]->size+1);
1972 memset(item->email->subject->subj, 0, list->items[x]->size+1);
1973 memcpy(item->email->subject->subj, list->items[x]->data, list->items[x]->size);
1974 } else {
1975 DEBUG_EMAIL(("Raw Subject has control codes\n"));
1976 // there might be some control bytes in the first and second bytes
1977 item->email->subject->off1 = (int)(unsigned)list->items[x]->data[0];
1978 item->email->subject->off2 = (int)(unsigned)list->items[x]->data[1];
1979 item->email->subject->subj = realloc(item->email->subject->subj, list->items[x]->size-1);
1980 memset(item->email->subject->subj, 0, list->items[x]->size-1);
1981 memcpy(item->email->subject->subj, &(list->items[x]->data[2]), list->items[x]->size-2);
1982 } 1972 }
1983 DEBUG_EMAIL(("%s\n", item->email->subject->subj)); 1973 list->items[x]->data += off;
1984 } else { 1974 list->items[x]->size -= off;
1985 // obviously outlook has decided not to be straight with this one. 1975 LIST_COPY_STR("Raw Subject", item->subject);
1986 item->email->subject->off1 = 0; 1976 list->items[x]->size += off;
1987 item->email->subject->off2 = 0; 1977 list->items[x]->data -= off;
1988 item->email->subject = NULL;
1989 DEBUG_EMAIL(("NULL subject detected\n"));
1990 } 1978 }
1991 break; 1979 break;
1992 case 0x0039: // PR_CLIENT_SUBMIT_TIME Date Email Sent/Created 1980 case 0x0039: // PR_CLIENT_SUBMIT_TIME Date Email Sent/Created
1993 DEBUG_EMAIL(("Date sent - "));
1994 MALLOC_EMAIL(item); 1981 MALLOC_EMAIL(item);
1995 LIST_COPY_TIME(item->email->sent_date); 1982 LIST_COPY_TIME(item->email->sent_date);
1996 DEBUG_EMAIL(("%s", fileTimeToAscii(item->email->sent_date))); 1983 DEBUG_EMAIL(("Date sent - %s\n", fileTimeToAscii(item->email->sent_date)));
1997 break; 1984 break;
1998 case 0x003B: // PR_SENT_REPRESENTING_SEARCH_KEY Sender address 1 1985 case 0x003B: // PR_SENT_REPRESENTING_SEARCH_KEY Sender address 1
1999 DEBUG_EMAIL(("Sent on behalf of address 1 - ")); 1986 LIST_COPY_EMAIL_STR("Sent on behalf of address 1", item->email->outlook_sender);
2000 MALLOC_EMAIL(item);
2001 LIST_COPY(item->email->outlook_sender, (char*));
2002 DEBUG_EMAIL(("%s\n", item->email->outlook_sender));
2003 break; 1987 break;
2004 case 0x003F: // PR_RECEIVED_BY_ENTRYID Structure containing Recipient 1988 case 0x003F: // PR_RECEIVED_BY_ENTRYID Structure containing Recipient
2005 DEBUG_EMAIL(("Recipient Structure 1 -- NOT HANDLED\n")); 1989 DEBUG_EMAIL(("Recipient Structure 1 -- NOT HANDLED\n"));
2006 break; 1990 break;
2007 case 0x0040: // PR_RECEIVED_BY_NAME Name of Recipient Structure 1991 case 0x0040: // PR_RECEIVED_BY_NAME Name of Recipient Structure
2008 DEBUG_EMAIL(("Received By Name 1 -- NOT HANDLED\n")); 1992 DEBUG_EMAIL(("Received By Name 1 -- NOT HANDLED\n"));
2009 break; 1993 break;
2010 case 0x0041: // PR_SENT_REPRESENTING_ENTRYID Structure containing Sender 1994 case 0x0041: // PR_SENT_REPRESENTING_ENTRYID Structure containing Sender
2011 DEBUG_EMAIL(("Sent on behalf of Structure 1 -- NOT HANDLED\n")); 1995 DEBUG_EMAIL(("Sent on behalf of Structure 1 -- NOT HANDLED\n"));
2012 break; 1996 break;
2013 case 0x0042: // PR_SENT_REPRESENTING_NAME Name of Sender Structure 1997 case 0x0042: // PR_SENT_REPRESENTING_NAME
2014 DEBUG_EMAIL(("Sent on behalf of Structure Name - ")); 1998 LIST_COPY_EMAIL_STR("Sent on behalf of", item->email->outlook_sender_name);
2015 MALLOC_EMAIL(item);
2016 LIST_COPY(item->email->outlook_sender_name, (char*));
2017 DEBUG_EMAIL(("%s\n", item->email->outlook_sender_name));
2018 break; 1999 break;
2019 case 0x0043: // PR_RCVD_REPRESENTING_ENTRYID Recipient Structure 2 2000 case 0x0043: // PR_RCVD_REPRESENTING_ENTRYID Recipient Structure 2
2020 DEBUG_EMAIL(("Received on behalf of Structure -- NOT HANDLED\n")); 2001 DEBUG_EMAIL(("Received on behalf of Structure -- NOT HANDLED\n"));
2021 break; 2002 break;
2022 case 0x0044: // PR_RCVD_REPRESENTING_NAME Name of Recipient Structure 2 2003 case 0x0044: // PR_RCVD_REPRESENTING_NAME
2023 DEBUG_EMAIL(("Received on behalf of Structure Name -- NOT HANDLED\n")); 2004 LIST_COPY_EMAIL_STR("Received on behalf of", item->email->outlook_recipient_name);
2024 MALLOC_EMAIL(item);
2025 LIST_COPY(item->email->outlook_recipient_name, (char*));
2026 DEBUG_EMAIL(("%s\n", item->email->outlook_recipient_name));
2027 break; 2005 break;
2028 case 0x004F: // PR_REPLY_RECIPIENT_ENTRIES Reply-To Structure 2006 case 0x004F: // PR_REPLY_RECIPIENT_ENTRIES Reply-To Structure
2029 DEBUG_EMAIL(("Reply-To Structure -- NOT HANDLED\n")); 2007 DEBUG_EMAIL(("Reply-To Structure -- NOT HANDLED\n"));
2030 break; 2008 break;
2031 case 0x0050: // PR_REPLY_RECIPIENT_NAMES Name of Reply-To Structure 2009 case 0x0050: // PR_REPLY_RECIPIENT_NAMES Name of Reply-To Structure
2032 DEBUG_EMAIL(("Name of Reply-To Structure -")); 2010 LIST_COPY_EMAIL_STR("Reply-To", item->email->reply_to);
2033 MALLOC_EMAIL(item);
2034 LIST_COPY(item->email->reply_to, (char*));
2035 DEBUG_EMAIL(("%s\n", item->email->reply_to));
2036 break; 2011 break;
2037 case 0x0051: // PR_RECEIVED_BY_SEARCH_KEY Recipient Address 1 2012 case 0x0051: // PR_RECEIVED_BY_SEARCH_KEY Recipient Address 1
2038 DEBUG_EMAIL(("Recipient's Address 1 (Search Key) - ")); 2013 LIST_COPY_EMAIL_STR("Recipient's Address 1", item->email->outlook_recipient);
2039 MALLOC_EMAIL(item);
2040 LIST_COPY (item->email->outlook_recipient, (char*));
2041 DEBUG_EMAIL(("%s\n", item->email->outlook_recipient));
2042 break; 2014 break;
2043 case 0x0052: // PR_RCVD_REPRESENTING_SEARCH_KEY Recipient Address 2 2015 case 0x0052: // PR_RCVD_REPRESENTING_SEARCH_KEY Recipient Address 2
2044 DEBUG_EMAIL(("Received on behalf of Address (Search Key) - ")); 2016 LIST_COPY_EMAIL_STR("Recipient's Address 2", item->email->outlook_recipient2);
2045 MALLOC_EMAIL(item);
2046 LIST_COPY(item->email->outlook_recipient2, (char*));
2047 DEBUG_EMAIL(("%s\n", item->email->outlook_recipient2));
2048 break; 2017 break;
2049 case 0x0057: // PR_MESSAGE_TO_ME 2018 case 0x0057: // PR_MESSAGE_TO_ME
2050 // this user is listed explicitly in the TO address 2019 // this user is listed explicitly in the TO address
2051 DEBUG_EMAIL(("My address in TO field - ")); 2020 LIST_COPY_EMAIL_BOOL("My address in TO field", item->email->message_to_me);
2052 MALLOC_EMAIL(item);
2053 if (*(int16_t*)list->items[x]->data) {
2054 DEBUG_EMAIL(("True\n"));
2055 item->email->message_to_me = 1;
2056 } else {
2057 DEBUG_EMAIL(("False\n"));
2058 item->email->message_to_me = 0;
2059 }
2060 break; 2021 break;
2061 case 0x0058: // PR_MESSAGE_CC_ME 2022 case 0x0058: // PR_MESSAGE_CC_ME
2062 // this user is listed explicitly in the CC address 2023 // this user is listed explicitly in the CC address
2063 DEBUG_EMAIL(("My address in CC field - ")); 2024 LIST_COPY_EMAIL_BOOL("My address in CC field", item->email->message_cc_me);
2064 MALLOC_EMAIL(item);
2065 if (*(int16_t*)list->items[x]->data) {
2066 DEBUG_EMAIL(("True\n"));
2067 item->email->message_cc_me = 1;
2068 } else {
2069 DEBUG_EMAIL(("False\n"));
2070 item->email->message_cc_me = 0;
2071 }
2072 break; 2025 break;
2073 case 0x0059: // PR_MESSAGE_RECIP_ME 2026 case 0x0059: // PR_MESSAGE_RECIP_ME
2074 // this user appears in TO, CC or BCC address list 2027 // this user appears in TO, CC or BCC address list
2075 DEBUG_EMAIL(("Message addressed to me - ")); 2028 LIST_COPY_EMAIL_BOOL("Message addressed to me", item->email->message_recip_me);
2076 MALLOC_EMAIL(item);
2077 if (*(int16_t*)list->items[x]->data) {
2078 DEBUG_EMAIL(("True\n"));
2079 item->email->message_recip_me = 1;
2080 } else {
2081 DEBUG_EMAIL(("False\n"));
2082 item->email->message_recip_me = 0;
2083 }
2084 break; 2029 break;
2085 case 0x0063: // PR_RESPONSE_REQUESTED 2030 case 0x0063: // PR_RESPONSE_REQUESTED
2086 DEBUG_EMAIL(("Response requested - ")); 2031 LIST_COPY_BOOL("Response requested", item->response_requested);
2087 if (*(int16_t*)list->items[x]->data) {
2088 DEBUG_EMAIL(("True\n"));
2089 item->response_requested = 1;
2090 } else {
2091 DEBUG_EMAIL(("False\n"));
2092 item->response_requested = 0;
2093 }
2094 break; 2032 break;
2095 case 0x0064: // PR_SENT_REPRESENTING_ADDRTYPE Access method for Sender Address 2033 case 0x0064: // PR_SENT_REPRESENTING_ADDRTYPE Access method for Sender Address
2096 DEBUG_EMAIL(("Sent on behalf of address type - ")); 2034 LIST_COPY_EMAIL_STR("Sent on behalf of address type", item->email->sender_access);
2097 MALLOC_EMAIL(item);
2098 LIST_COPY(item->email->sender_access, (char*));
2099 DEBUG_EMAIL(("%s\n", item->email->sender_access));
2100 break; 2035 break;
2101 case 0x0065: // PR_SENT_REPRESENTING_EMAIL_ADDRESS Sender Address 2036 case 0x0065: // PR_SENT_REPRESENTING_EMAIL_ADDRESS Sender Address
2102 DEBUG_EMAIL(("Sent on behalf of Address - ")); 2037 LIST_COPY_EMAIL_STR("Sent on behalf of address", item->email->sender_address);
2103 MALLOC_EMAIL(item);
2104 LIST_COPY(item->email->sender_address, (char*));
2105 DEBUG_EMAIL(("%s\n", item->email->sender_address));
2106 break; 2038 break;
2107 case 0x0070: // PR_CONVERSATION_TOPIC Processed Subject 2039 case 0x0070: // PR_CONVERSATION_TOPIC Processed Subject
2108 DEBUG_EMAIL(("Processed Subject (Conversation Topic) - ")); 2040 LIST_COPY_EMAIL_STR("Processed Subject (Conversation Topic)", item->email->processed_subject);
2109 MALLOC_EMAIL(item);
2110 LIST_COPY(item->email->proc_subject, (char*));
2111 DEBUG_EMAIL(("%s\n", item->email->proc_subject));
2112 break; 2041 break;
2113 case 0x0071: // PR_CONVERSATION_INDEX 2042 case 0x0071: // PR_CONVERSATION_INDEX
2114 DEBUG_EMAIL(("Conversation Index - ")); 2043 DEBUG_EMAIL(("Conversation Index - "));
2115 MALLOC_EMAIL(item); 2044 MALLOC_EMAIL(item);
2116 memcpy(&(item->email->conv_index), list->items[x]->data, sizeof(item->email->conv_index)); 2045 memcpy(&(item->email->conv_index), list->items[x]->data, sizeof(item->email->conv_index));
2117 DEBUG_EMAIL(("%i\n", item->email->conv_index)); 2046 DEBUG_EMAIL(("%i\n", item->email->conv_index));
2118 break; 2047 break;
2119 case 0x0072: // PR_ORIGINAL_DISPLAY_BCC 2048 case 0x0072: // PR_ORIGINAL_DISPLAY_BCC
2120 DEBUG_EMAIL(("Original display bcc - ")); 2049 LIST_COPY_EMAIL_STR("Original display bcc", item->email->original_bcc);
2121 MALLOC_EMAIL(item);
2122 LIST_COPY(item->email->original_bcc, (char*));
2123 DEBUG_EMAIL(("%s\n", item->email->original_bcc));
2124 break; 2050 break;
2125 case 0x0073: // PR_ORIGINAL_DISPLAY_CC 2051 case 0x0073: // PR_ORIGINAL_DISPLAY_CC
2126 DEBUG_EMAIL(("Original display cc - ")); 2052 LIST_COPY_EMAIL_STR("Original display cc", item->email->original_cc);
2127 MALLOC_EMAIL(item);
2128 LIST_COPY(item->email->original_cc, (char*));
2129 DEBUG_EMAIL(("%s\n", item->email->original_cc));
2130 break; 2053 break;
2131 case 0x0074: // PR_ORIGINAL_DISPLAY_TO 2054 case 0x0074: // PR_ORIGINAL_DISPLAY_TO
2132 DEBUG_EMAIL(("Original display to - ")); 2055 LIST_COPY_EMAIL_STR("Original display to", item->email->original_to);
2133 MALLOC_EMAIL(item);
2134 LIST_COPY(item->email->original_to, (char*));
2135 DEBUG_EMAIL(("%s\n", item->email->original_to));
2136 break; 2056 break;
2137 case 0x0075: // PR_RECEIVED_BY_ADDRTYPE Recipient Access Method 2057 case 0x0075: // PR_RECEIVED_BY_ADDRTYPE Recipient Access Method
2138 DEBUG_EMAIL(("Received by Address type - ")); 2058 LIST_COPY_EMAIL_STR("Received by Address type", item->email->recip_access);
2139 MALLOC_EMAIL(item);
2140 LIST_COPY(item->email->recip_access, (char*));
2141 DEBUG_EMAIL(("%s\n", item->email->recip_access));
2142 break; 2059 break;
2143 case 0x0076: // PR_RECEIVED_BY_EMAIL_ADDRESS Recipient Address 2060 case 0x0076: // PR_RECEIVED_BY_EMAIL_ADDRESS Recipient Address
2144 DEBUG_EMAIL(("Received by Address - ")); 2061 LIST_COPY_EMAIL_STR("Received by Address", item->email->recip_address);
2145 MALLOC_EMAIL(item);
2146 LIST_COPY(item->email->recip_address, (char*));
2147 DEBUG_EMAIL(("%s\n", item->email->recip_address));
2148 break; 2062 break;
2149 case 0x0077: // PR_RCVD_REPRESENTING_ADDRTYPE Recipient Access Method 2 2063 case 0x0077: // PR_RCVD_REPRESENTING_ADDRTYPE Recipient Access Method 2
2150 DEBUG_EMAIL(("Received on behalf of Address type - ")); 2064 LIST_COPY_EMAIL_STR("Received on behalf of Address type", item->email->recip2_access);
2151 MALLOC_EMAIL(item);
2152 LIST_COPY(item->email->recip2_access, (char*));
2153 DEBUG_EMAIL(("%s\n", item->email->recip2_access));
2154 break; 2065 break;
2155 case 0x0078: // PR_RCVD_REPRESENTING_EMAIL_ADDRESS Recipient Address 2 2066 case 0x0078: // PR_RCVD_REPRESENTING_EMAIL_ADDRESS Recipient Address 2
2156 DEBUG_EMAIL(("Received on behalf of Address -")); 2067 LIST_COPY_EMAIL_STR("Received on behalf of Address", item->email->recip2_address);
2157 MALLOC_EMAIL(item);
2158 LIST_COPY(item->email->recip2_address, (char*));
2159 DEBUG_EMAIL(("%s\n", item->email->recip2_address));
2160 break; 2068 break;
2161 case 0x007D: // PR_TRANSPORT_MESSAGE_HEADERS Internet Header 2069 case 0x007D: // PR_TRANSPORT_MESSAGE_HEADERS Internet Header
2162 DEBUG_EMAIL(("Internet Header - ")); 2070 LIST_COPY_EMAIL_STR("Internet Header", item->email->header);
2163 MALLOC_EMAIL(item);
2164 LIST_COPY(item->email->header, (char*));
2165 DEBUG_EMAIL(("%s\n", item->email->header));
2166 break; 2071 break;
2167 case 0x0C04: // PR_NDR_REASON_CODE 2072 case 0x0C04: // PR_NDR_REASON_CODE
2168 MALLOC_EMAIL(item); 2073 MALLOC_EMAIL(item);
2169 memcpy(&(item->email->ndr_reason_code), list->items[x]->data, sizeof(item->email->ndr_reason_code)); 2074 memcpy(&(item->email->ndr_reason_code), list->items[x]->data, sizeof(item->email->ndr_reason_code));
2170 LE32_CPU(item->email->ndr_reason_code); 2075 LE32_CPU(item->email->ndr_reason_code);
2178 t = item->email->ndr_diag_code; 2083 t = item->email->ndr_diag_code;
2179 DEBUG_EMAIL(("NDR diag code - [%i]\n", (int)t)); 2084 DEBUG_EMAIL(("NDR diag code - [%i]\n", (int)t));
2180 break; 2085 break;
2181 case 0x0C06: // PR_NON_RECEIPT_NOTIFICATION_REQUESTED 2086 case 0x0C06: // PR_NON_RECEIPT_NOTIFICATION_REQUESTED
2182 DEBUG_EMAIL(("Non-Receipt Notification Requested - (ignored) - ")); 2087 DEBUG_EMAIL(("Non-Receipt Notification Requested - (ignored) - "));
2183 if (*(int16_t*)list->items[x]->data) {
2184 DEBUG_EMAIL(("True\n"));
2185 } else {
2186 DEBUG_EMAIL(("False\n"));
2187 }
2188 break; 2088 break;
2189 case 0x0C17: // PR_REPLY_REQUESTED 2089 case 0x0C17: // PR_REPLY_REQUESTED
2190 DEBUG_EMAIL(("Reply Requested - ")); 2090 LIST_COPY_EMAIL_BOOL("Reply Requested", item->email->reply_requested);
2191 MALLOC_EMAIL(item);
2192 if (*(int16_t*)list->items[x]->data) {
2193 DEBUG_EMAIL(("True\n"));
2194 item->email->reply_requested = 1;
2195 } else {
2196 DEBUG_EMAIL(("False\n"));
2197 item->email->reply_requested = 0;
2198 }
2199 break; 2091 break;
2200 case 0x0C19: // PR_SENDER_ENTRYID Sender Structure 2 2092 case 0x0C19: // PR_SENDER_ENTRYID Sender Structure 2
2201 DEBUG_EMAIL(("Sender Structure 2 -- NOT HANDLED\n")); 2093 DEBUG_EMAIL(("Sender Structure 2 -- NOT HANDLED\n"));
2202 break; 2094 break;
2203 case 0x0C1A: // PR_SENDER_NAME Name of Sender Structure 2 2095 case 0x0C1A: // PR_SENDER_NAME Name of Sender Structure 2
2204 DEBUG_EMAIL(("Name of Sender Structure 2 -- NOT HANDLED\n")); 2096 DEBUG_EMAIL(("Name of Sender Structure 2 -- NOT HANDLED\n"));
2205 break; 2097 break;
2206 case 0x0C1B: // PR_SUPPLEMENTARY_INFO 2098 case 0x0C1B: // PR_SUPPLEMENTARY_INFO
2207 DEBUG_EMAIL(("Supplementary info - ")); 2099 LIST_COPY_EMAIL_STR("Supplementary info", item->email->supplementary_info);
2208 MALLOC_EMAIL(item);
2209 LIST_COPY(item->email->supplementary_info, (char*));
2210 DEBUG_EMAIL(("%s\n", item->email->supplementary_info));
2211 break; 2100 break;
2212 case 0x0C1D: // PR_SENDER_SEARCH_KEY Name of Sender Address 2 2101 case 0x0C1D: // PR_SENDER_SEARCH_KEY Name of Sender Address 2
2213 DEBUG_EMAIL(("Name of Sender Address 2 (Sender search key) - ")); 2102 LIST_COPY_EMAIL_STR("Name of Sender Address 2 (Sender search key)", item->email->outlook_sender2);
2214 MALLOC_EMAIL(item);
2215 LIST_COPY(item->email->outlook_sender2, (char*));
2216 DEBUG_EMAIL(("%s\n", item->email->outlook_sender2));
2217 break; 2103 break;
2218 case 0x0C1E: // PR_SENDER_ADDRTYPE Sender Address 2 access method 2104 case 0x0C1E: // PR_SENDER_ADDRTYPE Sender Address 2 access method
2219 DEBUG_EMAIL(("Sender Address type - ")); 2105 LIST_COPY_EMAIL_STR("Sender Address type", item->email->sender2_access);
2220 MALLOC_EMAIL(item);
2221 LIST_COPY(item->email->sender2_access, (char*));
2222 DEBUG_EMAIL(("%s\n", item->email->sender2_access));
2223 break; 2106 break;
2224 case 0x0C1F: // PR_SENDER_EMAIL_ADDRESS Sender Address 2 2107 case 0x0C1F: // PR_SENDER_EMAIL_ADDRESS Sender Address 2
2225 DEBUG_EMAIL(("Sender Address - ")); 2108 LIST_COPY_EMAIL_STR("Sender Address", item->email->sender2_address);
2226 MALLOC_EMAIL(item);
2227 LIST_COPY(item->email->sender2_address, (char*));
2228 DEBUG_EMAIL(("%s\n", item->email->sender2_address));
2229 break; 2109 break;
2230 case 0x0C20: // PR_NDR_STATUS_CODE 2110 case 0x0C20: // PR_NDR_STATUS_CODE
2231 MALLOC_EMAIL(item); 2111 MALLOC_EMAIL(item);
2232 memcpy(&(item->email->ndr_status_code), list->items[x]->data, sizeof(item->email->ndr_status_code)); 2112 memcpy(&(item->email->ndr_status_code), list->items[x]->data, sizeof(item->email->ndr_status_code));
2233 LE32_CPU(item->email->ndr_status_code); 2113 LE32_CPU(item->email->ndr_status_code);
2234 t = item->email->ndr_status_code; 2114 t = item->email->ndr_status_code;
2235 DEBUG_EMAIL(("NDR status code - [%i]\n", (int)t)); 2115 DEBUG_EMAIL(("NDR status code - [%i]\n", (int)t));
2236 break; 2116 break;
2237 case 0x0E01: // PR_DELETE_AFTER_SUBMIT 2117 case 0x0E01: // PR_DELETE_AFTER_SUBMIT
2238 // I am not too sure how this works 2118 LIST_COPY_EMAIL_BOOL("Delete after submit", item->email->delete_after_submit);
2239 DEBUG_EMAIL(("Delete after submit - "));
2240 MALLOC_EMAIL(item);
2241 if (*(int16_t*)list->items[x]->data) {
2242 DEBUG_EMAIL(("True\n"));
2243 item->email->delete_after_submit = 1;
2244 } else {
2245 DEBUG_EMAIL(("False\n"));
2246 item->email->delete_after_submit = 0;
2247 }
2248 break; 2119 break;
2249 case 0x0E02: // PR_DISPLAY_BCC BCC Addresses 2120 case 0x0E02: // PR_DISPLAY_BCC BCC Addresses
2250 DEBUG_EMAIL(("Display BCC Addresses - ")); 2121 LIST_COPY_EMAIL_STR("Display BCC Addresses", item->email->bcc_address);
2251 MALLOC_EMAIL(item);
2252 LIST_COPY(item->email->bcc_address, (char*));
2253 DEBUG_EMAIL(("%s\n", item->email->bcc_address));
2254 break; 2122 break;
2255 case 0x0E03: // PR_DISPLAY_CC CC Addresses 2123 case 0x0E03: // PR_DISPLAY_CC CC Addresses
2256 DEBUG_EMAIL(("Display CC Addresses - ")); 2124 LIST_COPY_EMAIL_STR("Display CC Addresses", item->email->cc_address);
2257 MALLOC_EMAIL(item);
2258 LIST_COPY(item->email->cc_address, (char*));
2259 DEBUG_EMAIL(("%s\n", item->email->cc_address));
2260 break; 2125 break;
2261 case 0x0E04: // PR_DISPLAY_TO Address Sent-To 2126 case 0x0E04: // PR_DISPLAY_TO Address Sent-To
2262 DEBUG_EMAIL(("Display Sent-To Address - ")); 2127 LIST_COPY_EMAIL_STR("Display Sent-To Address", item->email->sentto_address);
2263 MALLOC_EMAIL(item);
2264 LIST_COPY(item->email->sentto_address, (char*));
2265 DEBUG_EMAIL(("%s\n", item->email->sentto_address));
2266 break; 2128 break;
2267 case 0x0E06: // PR_MESSAGE_DELIVERY_TIME Date 3 - Email Arrival Date 2129 case 0x0E06: // PR_MESSAGE_DELIVERY_TIME Date 3 - Email Arrival Date
2268 DEBUG_EMAIL(("Date 3 (Delivery Time) - ")); 2130 DEBUG_EMAIL(("Date 3 (Delivery Time) - "));
2269 MALLOC_EMAIL(item); 2131 MALLOC_EMAIL(item);
2270 LIST_COPY_TIME(item->email->arrival_date); 2132 LIST_COPY_TIME(item->email->arrival_date);
2304 case 0x0E1F: // PR_RTF_IN_SYNC 2166 case 0x0E1F: // PR_RTF_IN_SYNC
2305 // True means that the rtf version is same as text body 2167 // True means that the rtf version is same as text body
2306 // False means rtf version is more up-to-date than text body 2168 // False means rtf version is more up-to-date than text body
2307 // if this value doesn't exist, text body is more up-to-date than rtf and 2169 // if this value doesn't exist, text body is more up-to-date than rtf and
2308 // cannot update to the rtf 2170 // cannot update to the rtf
2309 DEBUG_EMAIL(("Compressed RTF in Sync - ")); 2171 LIST_COPY_EMAIL_BOOL("Compressed RTF in Sync", item->email->rtf_in_sync);
2310 MALLOC_EMAIL(item);
2311 if (*(int16_t*)list->items[x]->data) {
2312 DEBUG_EMAIL(("True\n"));
2313 item->email->rtf_in_sync = 1;
2314 } else {
2315 DEBUG_EMAIL(("False\n"));
2316 item->email->rtf_in_sync = 0;
2317 }
2318 break; 2172 break;
2319 case 0x0E20: // PR_ATTACH_SIZE binary Attachment data in record 2173 case 0x0E20: // PR_ATTACH_SIZE binary Attachment data in record
2320 DEBUG_EMAIL(("Attachment Size - ")); 2174 DEBUG_EMAIL(("Attachment Size - "));
2321 NULL_CHECK(attach); 2175 NULL_CHECK(attach);
2322 t = (*(int32_t*)list->items[x]->data); 2176 t = (*(int32_t*)list->items[x]->data);
2330 item->record_key_size = list->items[x]->size; 2184 item->record_key_size = list->items[x]->size;
2331 DEBUG_EMAIL_HEXPRINT(item->record_key, item->record_key_size); 2185 DEBUG_EMAIL_HEXPRINT(item->record_key, item->record_key_size);
2332 DEBUG_EMAIL(("\n")); 2186 DEBUG_EMAIL(("\n"));
2333 break; 2187 break;
2334 case 0x1000: // PR_BODY 2188 case 0x1000: // PR_BODY
2335 MALLOC_EMAIL(item); 2189 LIST_COPY_EMAIL_STR("Plain Text body", item->body);
2336 LIST_COPY(item->email->body, (char*));
2337 item->email->body_was_unicode = (list->items[x]->type == 0x1f) ? 1 : 0;
2338 DEBUG_EMAIL(("Plain Text body %s - \n%s\n", (item->email->body_was_unicode) ? "unicode" : "sbcs",
2339 item->email->body));
2340 break; 2190 break;
2341 case 0x1001: // PR_REPORT_TEXT 2191 case 0x1001: // PR_REPORT_TEXT
2342 DEBUG_EMAIL(("Report Text - ")); 2192 LIST_COPY_EMAIL_STR("Report Text", item->email->report_text);
2343 MALLOC_EMAIL(item);
2344 LIST_COPY(item->email->report_text, (char*));
2345 item->email->report_was_unicode = (list->items[x]->type == 0x1f) ? 1 : 0;
2346 DEBUG_EMAIL(("Report Text %s - \n%s\n", (item->email->report_was_unicode) ? "unicode" : "sbcs",
2347 item->email->report_text));
2348 break; 2193 break;
2349 case 0x1006: // PR_RTF_SYNC_BODY_CRC 2194 case 0x1006: // PR_RTF_SYNC_BODY_CRC
2350 DEBUG_EMAIL(("RTF Sync Body CRC - ")); 2195 DEBUG_EMAIL(("RTF Sync Body CRC - "));
2351 MALLOC_EMAIL(item); 2196 MALLOC_EMAIL(item);
2352 memcpy(&(item->email->rtf_body_crc), list->items[x]->data, sizeof(item->email->rtf_body_crc)); 2197 memcpy(&(item->email->rtf_body_crc), list->items[x]->data, sizeof(item->email->rtf_body_crc));
2363 DEBUG_EMAIL(("%i [%#x]\n", item->email->rtf_body_char_count, item->email->rtf_body_char_count)); 2208 DEBUG_EMAIL(("%i [%#x]\n", item->email->rtf_body_char_count, item->email->rtf_body_char_count));
2364 break; 2209 break;
2365 case 0x1008: // PR_RTF_SYNC_BODY_TAG 2210 case 0x1008: // PR_RTF_SYNC_BODY_TAG
2366 // the first couple of lines of RTF body so that after modification, then beginning can 2211 // the first couple of lines of RTF body so that after modification, then beginning can
2367 // once again be found 2212 // once again be found
2368 DEBUG_EMAIL(("RTF Sync body tag - ")); 2213 LIST_COPY_EMAIL_STR("RTF Sync body tag", item->email->rtf_body_tag);
2369 MALLOC_EMAIL(item);
2370 LIST_COPY(item->email->rtf_body_tag, (char*));
2371 DEBUG_EMAIL(("%s\n", item->email->rtf_body_tag));
2372 break; 2214 break;
2373 case 0x1009: // PR_RTF_COMPRESSED 2215 case 0x1009: // PR_RTF_COMPRESSED
2374 // rtf data is lzw compressed 2216 // rtf data is lzw compressed
2375 DEBUG_EMAIL(("RTF Compressed body - ")); 2217 DEBUG_EMAIL(("RTF Compressed body - "));
2376 MALLOC_EMAIL(item); 2218 MALLOC_EMAIL(item);
2390 MALLOC_EMAIL(item); 2232 MALLOC_EMAIL(item);
2391 memcpy(&(item->email->rtf_ws_trailing_count), list->items[x]->data, sizeof(item->email->rtf_ws_trailing_count)); 2233 memcpy(&(item->email->rtf_ws_trailing_count), list->items[x]->data, sizeof(item->email->rtf_ws_trailing_count));
2392 DEBUG_EMAIL(("%i\n", item->email->rtf_ws_trailing_count)); 2234 DEBUG_EMAIL(("%i\n", item->email->rtf_ws_trailing_count));
2393 break; 2235 break;
2394 case 0x1013: // HTML body 2236 case 0x1013: // HTML body
2395 MALLOC_EMAIL(item); 2237 LIST_COPY_EMAIL_STR("HTML body", item->email->htmlbody);
2396 LIST_COPY(item->email->htmlbody, (char*));
2397 item->email->htmlbody_was_unicode = (list->items[x]->type == 0x1f) ? 1 : 0;
2398 DEBUG_EMAIL(("HTML body %s - \n%s\n", (item->email->htmlbody_was_unicode) ? "unicode" : "sbcs",
2399 item->email->htmlbody));
2400 break; 2238 break;
2401 case 0x1035: // Message ID 2239 case 0x1035: // Message ID
2402 DEBUG_EMAIL(("Message ID - ")); 2240 LIST_COPY_EMAIL_STR("Message ID", item->email->messageid);
2403 MALLOC_EMAIL(item);
2404 LIST_COPY(item->email->messageid, (char*));
2405 DEBUG_EMAIL(("%s\n", item->email->messageid));
2406 break; 2241 break;
2407 case 0x1042: // in-reply-to 2242 case 0x1042: // in-reply-to
2408 DEBUG_EMAIL(("In-Reply-To - ")); 2243 LIST_COPY_EMAIL_STR("In-Reply-To", item->email->in_reply_to);
2409 MALLOC_EMAIL(item);
2410 LIST_COPY(item->email->in_reply_to, (char*));
2411 DEBUG_EMAIL(("%s\n", item->email->in_reply_to));
2412 break; 2244 break;
2413 case 0x1046: // Return Path - this seems to be the message-id of the rfc822 mail that is being returned 2245 case 0x1046: // Return Path - this seems to be the message-id of the rfc822 mail that is being returned
2414 DEBUG_EMAIL(("Return Path - ")); 2246 LIST_COPY_EMAIL_STR("Return Path", item->email->return_path_address);
2415 MALLOC_EMAIL(item);
2416 LIST_COPY(item->email->return_path_address, (char*));
2417 DEBUG_EMAIL(("%s\n", item->email->return_path_address));
2418 break; 2247 break;
2419 case 0x3001: // PR_DISPLAY_NAME File As 2248 case 0x3001: // PR_DISPLAY_NAME File As
2420 DEBUG_EMAIL(("Display Name - ")); 2249 LIST_COPY_STR("Display Name", item->file_as);
2421 LIST_COPY(item->file_as, (char*));
2422 DEBUG_EMAIL(("%s\n", item->file_as));
2423 break; 2250 break;
2424 case 0x3002: // PR_ADDRTYPE 2251 case 0x3002: // PR_ADDRTYPE
2425 DEBUG_EMAIL(("Address Type - ")); 2252 LIST_COPY_CONTACT_STR("Address Type", item->contact->address1_transport);
2426 MALLOC_CONTACT(item);
2427 LIST_COPY(item->contact->address1_transport, (char*));
2428 DEBUG_EMAIL(("|%s|\n", item->contact->address1_transport));
2429 break; 2253 break;
2430 case 0x3003: // PR_EMAIL_ADDRESS 2254 case 0x3003: // PR_EMAIL_ADDRESS
2431 // Contact's email address 2255 LIST_COPY_CONTACT_STR("Contact email Address", item->contact->address1);
2432 DEBUG_EMAIL(("Contact Address - "));
2433 MALLOC_CONTACT(item);
2434 LIST_COPY(item->contact->address1, (char*));
2435 DEBUG_EMAIL(("|%s|\n", item->contact->address1));
2436 break; 2256 break;
2437 case 0x3004: // PR_COMMENT Comment for item - usually folders 2257 case 0x3004: // PR_COMMENT Comment for item - usually folders
2438 DEBUG_EMAIL(("Comment - ")); 2258 LIST_COPY_STR("Comment", item->comment);
2439 LIST_COPY(item->comment, (char*));
2440 DEBUG_EMAIL(("%s\n", item->comment));
2441 break; 2259 break;
2442 case 0x3007: // PR_CREATION_TIME Date 4 - Creation Date? 2260 case 0x3007: // PR_CREATION_TIME Date 4 - Creation Date?
2443 DEBUG_EMAIL(("Date 4 (Item Creation Date) - ")); 2261 DEBUG_EMAIL(("Date 4 (Item Creation Date) - "));
2444 LIST_COPY_TIME(item->create_date); 2262 LIST_COPY_TIME(item->create_date);
2445 DEBUG_EMAIL(("%s", fileTimeToAscii(item->create_date))); 2263 DEBUG_EMAIL(("%s", fileTimeToAscii(item->create_date)));
2530 memcpy(&(item->folder->unseen_email_count), list->items[x]->data, sizeof(item->folder->unseen_email_count)); 2348 memcpy(&(item->folder->unseen_email_count), list->items[x]->data, sizeof(item->folder->unseen_email_count));
2531 LE32_CPU(item->folder->unseen_email_count); 2349 LE32_CPU(item->folder->unseen_email_count);
2532 DEBUG_EMAIL(("%i\n", item->folder->unseen_email_count)); 2350 DEBUG_EMAIL(("%i\n", item->folder->unseen_email_count));
2533 break; 2351 break;
2534 case 0x360A: // PR_SUBFOLDERS Has children 2352 case 0x360A: // PR_SUBFOLDERS Has children
2535 DEBUG_EMAIL(("Has Subfolders - "));
2536 MALLOC_FOLDER(item); 2353 MALLOC_FOLDER(item);
2537 if (*(int16_t*)list->items[x]->data) { 2354 LIST_COPY_BOOL("Has Subfolders", item->folder->subfolder);
2538 DEBUG_EMAIL(("True\n"));
2539 item->folder->subfolder = 1;
2540 } else {
2541 DEBUG_EMAIL(("False\n"));
2542 item->folder->subfolder = 0;
2543 }
2544 break; 2355 break;
2545 case 0x3613: // PR_CONTAINER_CLASS IPF.x 2356 case 0x3613: // PR_CONTAINER_CLASS IPF.x
2546 DEBUG_EMAIL(("IPF.x - ")); 2357 DEBUG_EMAIL(("IPF.x - "));
2547 LIST_COPY(item->ascii_type, (char*)); 2358 LIST_COPY(item->ascii_type, (char*));
2548 if (strncmp("IPF.Note", item->ascii_type, 8) == 0) 2359 if (strncmp("IPF.Note", item->ascii_type, 8) == 0)
2583 attach->size = list->items[x]->size; 2394 attach->size = list->items[x]->size;
2584 DEBUG_EMAIL(("NOT PRINTED\n")); 2395 DEBUG_EMAIL(("NOT PRINTED\n"));
2585 } 2396 }
2586 break; 2397 break;
2587 case 0x3704: // PR_ATTACH_FILENAME Attachment filename (8.3) 2398 case 0x3704: // PR_ATTACH_FILENAME Attachment filename (8.3)
2588 DEBUG_EMAIL(("Attachment Filename - "));
2589 NULL_CHECK(attach); 2399 NULL_CHECK(attach);
2590 LIST_COPY(attach->filename1, (char*)); 2400 LIST_COPY_STR("Attachment Filename", attach->filename1);
2591 DEBUG_EMAIL(("%s\n", attach->filename1));
2592 break; 2401 break;
2593 case 0x3705: // PR_ATTACH_METHOD 2402 case 0x3705: // PR_ATTACH_METHOD
2594 // 0 - No Attachment 2403 // 0 - No Attachment
2595 // 1 - Attach by Value 2404 // 1 - Attach by Value
2596 // 2 - Attach by reference 2405 // 2 - Attach by reference
2609 (t==3?"Attach by Ref. Resolve": 2418 (t==3?"Attach by Ref. Resolve":
2610 (t==4?"Attach by Ref. Only": 2419 (t==4?"Attach by Ref. Only":
2611 (t==5?"Embedded Message":"OLE")))))),t)); 2420 (t==5?"Embedded Message":"OLE")))))),t));
2612 break; 2421 break;
2613 case 0x3707: // PR_ATTACH_LONG_FILENAME Attachment filename (long?) 2422 case 0x3707: // PR_ATTACH_LONG_FILENAME Attachment filename (long?)
2614 DEBUG_EMAIL(("Attachment Filename long - "));
2615 NULL_CHECK(attach); 2423 NULL_CHECK(attach);
2616 LIST_COPY(attach->filename2, (char*)); 2424 LIST_COPY_STR("Attachment Filename long", attach->filename2);
2617 DEBUG_EMAIL(("%s\n", attach->filename2));
2618 break; 2425 break;
2619 case 0x370B: // PR_RENDERING_POSITION 2426 case 0x370B: // PR_RENDERING_POSITION
2620 // position in characters that the attachment appears in the plain text body 2427 // position in characters that the attachment appears in the plain text body
2621 DEBUG_EMAIL(("Attachment Position - ")); 2428 DEBUG_EMAIL(("Attachment Position - "));
2622 NULL_CHECK(attach); 2429 NULL_CHECK(attach);
2623 memcpy(&(attach->position), list->items[x]->data, sizeof(attach->position)); 2430 memcpy(&(attach->position), list->items[x]->data, sizeof(attach->position));
2624 LE32_CPU(attach->position); 2431 LE32_CPU(attach->position);
2625 DEBUG_EMAIL(("%i [%#x]\n", attach->position)); 2432 DEBUG_EMAIL(("%i [%#x]\n", attach->position));
2626 break; 2433 break;
2627 case 0x370E: // PR_ATTACH_MIME_TAG Mime type of encoding 2434 case 0x370E: // PR_ATTACH_MIME_TAG Mime type of encoding
2628 DEBUG_EMAIL(("Attachment mime encoding - "));
2629 NULL_CHECK(attach); 2435 NULL_CHECK(attach);
2630 LIST_COPY(attach->mimetype, (char*)); 2436 LIST_COPY_STR("Attachment mime encoding", attach->mimetype);
2631 DEBUG_EMAIL(("%s\n", attach->mimetype));
2632 break; 2437 break;
2633 case 0x3710: // PR_ATTACH_MIME_SEQUENCE 2438 case 0x3710: // PR_ATTACH_MIME_SEQUENCE
2634 // sequence number for mime parts. Includes body 2439 // sequence number for mime parts. Includes body
2635 DEBUG_EMAIL(("Attachment Mime Sequence - ")); 2440 DEBUG_EMAIL(("Attachment Mime Sequence - "));
2636 NULL_CHECK(attach); 2441 NULL_CHECK(attach);
2637 memcpy(&(attach->sequence), list->items[x]->data, sizeof(attach->sequence)); 2442 memcpy(&(attach->sequence), list->items[x]->data, sizeof(attach->sequence));
2638 LE32_CPU(attach->sequence); 2443 LE32_CPU(attach->sequence);
2639 DEBUG_EMAIL(("%i\n", attach->sequence)); 2444 DEBUG_EMAIL(("%i\n", attach->sequence));
2640 break; 2445 break;
2641 case 0x3A00: // PR_ACCOUNT 2446 case 0x3A00: // PR_ACCOUNT
2642 DEBUG_EMAIL(("Contact's Account name - ")); 2447 LIST_COPY_CONTACT_STR("Contact's Account name", item->contact->account_name);
2643 MALLOC_CONTACT(item);
2644 LIST_COPY(item->contact->account_name, (char*));
2645 DEBUG_EMAIL(("%s\n", item->contact->account_name));
2646 break; 2448 break;
2647 case 0x3A01: // PR_ALTERNATE_RECIPIENT 2449 case 0x3A01: // PR_ALTERNATE_RECIPIENT
2648 DEBUG_EMAIL(("Contact Alternate Recipient - NOT PROCESSED\n")); 2450 DEBUG_EMAIL(("Contact Alternate Recipient - NOT PROCESSED\n"));
2649 break; 2451 break;
2650 case 0x3A02: // PR_CALLBACK_TELEPHONE_NUMBER 2452 case 0x3A02: // PR_CALLBACK_TELEPHONE_NUMBER
2651 DEBUG_EMAIL(("Callback telephone number - ")); 2453 LIST_COPY_CONTACT_STR("Callback telephone number", item->contact->callback_phone);
2652 MALLOC_CONTACT(item);
2653 LIST_COPY(item->contact->callback_phone, (char*));
2654 DEBUG_EMAIL(("%s\n", item->contact->callback_phone));
2655 break; 2454 break;
2656 case 0x3A03: // PR_CONVERSION_PROHIBITED 2455 case 0x3A03: // PR_CONVERSION_PROHIBITED
2657 DEBUG_EMAIL(("Message Conversion Prohibited - ")); 2456 LIST_COPY_EMAIL_BOOL("Message Conversion Prohibited", item->email->conversion_prohibited);
2658 MALLOC_EMAIL(item);
2659 if (*(int16_t*)list->items[x]->data) {
2660 DEBUG_EMAIL(("True\n"));
2661 item->email->conversion_prohib = 1;
2662 } else {
2663 DEBUG_EMAIL(("False\n"));
2664 item->email->conversion_prohib = 0;
2665 }
2666 break; 2457 break;
2667 case 0x3A05: // PR_GENERATION suffix 2458 case 0x3A05: // PR_GENERATION suffix
2668 DEBUG_EMAIL(("Contacts Suffix - ")); 2459 LIST_COPY_CONTACT_STR("Contacts Suffix", item->contact->suffix);
2669 MALLOC_CONTACT(item);
2670 LIST_COPY(item->contact->suffix, (char*));
2671 DEBUG_EMAIL(("%s\n", item->contact->suffix));
2672 break; 2460 break;
2673 case 0x3A06: // PR_GIVEN_NAME Contact's first name 2461 case 0x3A06: // PR_GIVEN_NAME Contact's first name
2674 DEBUG_EMAIL(("Contacts First Name - ")); 2462 LIST_COPY_CONTACT_STR("Contacts First Name", item->contact->first_name);
2675 MALLOC_CONTACT(item);
2676 LIST_COPY(item->contact->first_name, (char*));
2677 DEBUG_EMAIL(("%s\n", item->contact->first_name));
2678 break; 2463 break;
2679 case 0x3A07: // PR_GOVERNMENT_ID_NUMBER 2464 case 0x3A07: // PR_GOVERNMENT_ID_NUMBER
2680 DEBUG_EMAIL(("Contacts Government ID Number - ")); 2465 LIST_COPY_CONTACT_STR("Contacts Government ID Number", item->contact->gov_id);
2681 MALLOC_CONTACT(item);
2682 LIST_COPY(item->contact->gov_id, (char*));
2683 DEBUG_EMAIL(("%s\n", item->contact->gov_id));
2684 break; 2466 break;
2685 case 0x3A08: // PR_BUSINESS_TELEPHONE_NUMBER 2467 case 0x3A08: // PR_BUSINESS_TELEPHONE_NUMBER
2686 DEBUG_EMAIL(("Business Telephone Number - ")); 2468 LIST_COPY_CONTACT_STR("Business Telephone Number", item->contact->business_phone);
2687 MALLOC_CONTACT(item);
2688 LIST_COPY(item->contact->business_phone, (char*));
2689 DEBUG_EMAIL(("%s\n", item->contact->business_phone));
2690 break; 2469 break;
2691 case 0x3A09: // PR_HOME_TELEPHONE_NUMBER 2470 case 0x3A09: // PR_HOME_TELEPHONE_NUMBER
2692 DEBUG_EMAIL(("Home Telephone Number - ")); 2471 LIST_COPY_CONTACT_STR("Home Telephone Number", item->contact->home_phone);
2693 MALLOC_CONTACT(item);
2694 LIST_COPY(item->contact->home_phone, (char*));
2695 DEBUG_EMAIL(("%s\n", item->contact->home_phone));
2696 break; 2472 break;
2697 case 0x3A0A: // PR_INITIALS Contact's Initials 2473 case 0x3A0A: // PR_INITIALS Contact's Initials
2698 DEBUG_EMAIL(("Contacts Initials - ")); 2474 LIST_COPY_CONTACT_STR("Contacts Initials", item->contact->initials);
2699 MALLOC_CONTACT(item);
2700 LIST_COPY(item->contact->initials, (char*));
2701 DEBUG_EMAIL(("%s\n", item->contact->initials));
2702 break; 2475 break;
2703 case 0x3A0B: // PR_KEYWORD 2476 case 0x3A0B: // PR_KEYWORD
2704 DEBUG_EMAIL(("Keyword - ")); 2477 LIST_COPY_CONTACT_STR("Keyword", item->contact->keyword);
2705 MALLOC_CONTACT(item);
2706 LIST_COPY(item->contact->keyword, (char*));
2707 DEBUG_EMAIL(("%s\n", item->contact->keyword));
2708 break; 2478 break;
2709 case 0x3A0C: // PR_LANGUAGE 2479 case 0x3A0C: // PR_LANGUAGE
2710 DEBUG_EMAIL(("Contact's Language - ")); 2480 LIST_COPY_CONTACT_STR("Contact's Language", item->contact->language);
2711 MALLOC_CONTACT(item);
2712 LIST_COPY(item->contact->language, (char*));
2713 DEBUG_EMAIL(("%s\n", item->contact->language));
2714 break; 2481 break;
2715 case 0x3A0D: // PR_LOCATION 2482 case 0x3A0D: // PR_LOCATION
2716 DEBUG_EMAIL(("Contact's Location - ")); 2483 LIST_COPY_CONTACT_STR("Contact's Location", item->contact->location);
2717 MALLOC_CONTACT(item);
2718 LIST_COPY(item->contact->location, (char*));
2719 DEBUG_EMAIL(("%s\n", item->contact->location));
2720 break; 2484 break;
2721 case 0x3A0E: // PR_MAIL_PERMISSION - Can the recipient receive and send email 2485 case 0x3A0E: // PR_MAIL_PERMISSION - Can the recipient receive and send email
2722 DEBUG_EMAIL(("Mail Permission - ")); 2486 LIST_COPY_CONTACT_BOOL("Mail Permission", item->contact->mail_permission);
2723 MALLOC_CONTACT(item);
2724 if (*(int16_t*)list->items[x]->data) {
2725 DEBUG_EMAIL(("True\n"));
2726 item->contact->mail_permission = 1;
2727 } else {
2728 DEBUG_EMAIL(("False\n"));
2729 item->contact->mail_permission = 0;
2730 }
2731 break; 2487 break;
2732 case 0x3A0F: // PR_MHS_COMMON_NAME 2488 case 0x3A0F: // PR_MHS_COMMON_NAME
2733 DEBUG_EMAIL(("MHS Common Name - ")); 2489 LIST_COPY_CONTACT_STR("MHS Common Name", item->contact->common_name);
2734 MALLOC_EMAIL(item);
2735 LIST_COPY(item->email->common_name, (char*));
2736 DEBUG_EMAIL(("%s\n", item->email->common_name));
2737 break; 2490 break;
2738 case 0x3A10: // PR_ORGANIZATIONAL_ID_NUMBER 2491 case 0x3A10: // PR_ORGANIZATIONAL_ID_NUMBER
2739 DEBUG_EMAIL(("Organizational ID # - ")); 2492 LIST_COPY_CONTACT_STR("Organizational ID #", item->contact->org_id);
2740 MALLOC_CONTACT(item);
2741 LIST_COPY(item->contact->org_id, (char*));
2742 DEBUG_EMAIL(("%s\n", item->contact->org_id));
2743 break; 2493 break;
2744 case 0x3A11: // PR_SURNAME Contact's Surname 2494 case 0x3A11: // PR_SURNAME Contact's Surname
2745 DEBUG_EMAIL(("Contacts Surname - ")); 2495 LIST_COPY_CONTACT_STR("Contacts Surname", item->contact->surname);
2746 MALLOC_CONTACT(item);
2747 LIST_COPY(item->contact->surname, (char*));
2748 DEBUG_EMAIL(("%s\n", item->contact->surname));
2749 break; 2496 break;
2750 case 0x3A12: // PR_ORIGINAL_ENTRY_ID 2497 case 0x3A12: // PR_ORIGINAL_ENTRY_ID
2751 DEBUG_EMAIL(("Original Entry ID - NOT PROCESSED\n")); 2498 DEBUG_EMAIL(("Original Entry ID - NOT PROCESSED\n"));
2752 break; 2499 break;
2753 case 0x3A13: // PR_ORIGINAL_DISPLAY_NAME 2500 case 0x3A13: // PR_ORIGINAL_DISPLAY_NAME
2755 break; 2502 break;
2756 case 0x3A14: // PR_ORIGINAL_SEARCH_KEY 2503 case 0x3A14: // PR_ORIGINAL_SEARCH_KEY
2757 DEBUG_EMAIL(("Original Search Key - NOT PROCESSED\n")); 2504 DEBUG_EMAIL(("Original Search Key - NOT PROCESSED\n"));
2758 break; 2505 break;
2759 case 0x3A15: // PR_POSTAL_ADDRESS 2506 case 0x3A15: // PR_POSTAL_ADDRESS
2760 DEBUG_EMAIL(("Default Postal Address - ")); 2507 LIST_COPY_CONTACT_STR("Default Postal Address", item->contact->def_postal_address);
2761 MALLOC_CONTACT(item);
2762 LIST_COPY(item->contact->def_postal_address, (char*));
2763 DEBUG_EMAIL(("%s\n", item->contact->def_postal_address));
2764 break; 2508 break;
2765 case 0x3A16: // PR_COMPANY_NAME 2509 case 0x3A16: // PR_COMPANY_NAME
2766 DEBUG_EMAIL(("Company Name - ")); 2510 LIST_COPY_CONTACT_STR("Company Name", item->contact->company_name);
2767 MALLOC_CONTACT(item);
2768 LIST_COPY(item->contact->company_name, (char*));
2769 DEBUG_EMAIL(("%s\n", item->contact->company_name));
2770 break; 2511 break;
2771 case 0x3A17: // PR_TITLE - Job Title 2512 case 0x3A17: // PR_TITLE - Job Title
2772 DEBUG_EMAIL(("Job Title - ")); 2513 LIST_COPY_CONTACT_STR("Job Title", item->contact->job_title);
2773 MALLOC_CONTACT(item);
2774 LIST_COPY(item->contact->job_title, (char*));
2775 DEBUG_EMAIL(("%s\n", item->contact->job_title));
2776 break; 2514 break;
2777 case 0x3A18: // PR_DEPARTMENT_NAME 2515 case 0x3A18: // PR_DEPARTMENT_NAME
2778 DEBUG_EMAIL(("Department Name - ")); 2516 LIST_COPY_CONTACT_STR("Department Name", item->contact->department);
2779 MALLOC_CONTACT(item);
2780 LIST_COPY(item->contact->department, (char*));
2781 DEBUG_EMAIL(("%s\n", item->contact->department));
2782 break; 2517 break;
2783 case 0x3A19: // PR_OFFICE_LOCATION 2518 case 0x3A19: // PR_OFFICE_LOCATION
2784 DEBUG_EMAIL(("Office Location - ")); 2519 LIST_COPY_CONTACT_STR("Office Location", item->contact->office_loc);
2785 MALLOC_CONTACT(item);
2786 LIST_COPY(item->contact->office_loc, (char*));
2787 DEBUG_EMAIL(("%s\n", item->contact->office_loc));
2788 break; 2520 break;
2789 case 0x3A1A: // PR_PRIMARY_TELEPHONE_NUMBER 2521 case 0x3A1A: // PR_PRIMARY_TELEPHONE_NUMBER
2790 DEBUG_EMAIL(("Primary Telephone - ")); 2522 LIST_COPY_CONTACT_STR("Primary Telephone", item->contact->primary_phone);
2791 MALLOC_CONTACT(item);
2792 LIST_COPY(item->contact->primary_phone, (char*));
2793 DEBUG_EMAIL(("%s\n", item->contact->primary_phone));
2794 break; 2523 break;
2795 case 0x3A1B: // PR_BUSINESS2_TELEPHONE_NUMBER 2524 case 0x3A1B: // PR_BUSINESS2_TELEPHONE_NUMBER
2796 DEBUG_EMAIL(("Business Phone Number 2 - ")); 2525 LIST_COPY_CONTACT_STR("Business Phone Number 2", item->contact->business_phone2);
2797 MALLOC_CONTACT(item);
2798 LIST_COPY(item->contact->business_phone2, (char*));
2799 DEBUG_EMAIL(("%s\n", item->contact->business_phone2));
2800 break; 2526 break;
2801 case 0x3A1C: // PR_MOBILE_TELEPHONE_NUMBER 2527 case 0x3A1C: // PR_MOBILE_TELEPHONE_NUMBER
2802 DEBUG_EMAIL(("Mobile Phone Number - ")); 2528 LIST_COPY_CONTACT_STR("Mobile Phone Number", item->contact->mobile_phone);
2803 MALLOC_CONTACT(item);
2804 LIST_COPY(item->contact->mobile_phone, (char*));
2805 DEBUG_EMAIL(("%s\n", item->contact->mobile_phone));
2806 break; 2529 break;
2807 case 0x3A1D: // PR_RADIO_TELEPHONE_NUMBER 2530 case 0x3A1D: // PR_RADIO_TELEPHONE_NUMBER
2808 DEBUG_EMAIL(("Radio Phone Number - ")); 2531 LIST_COPY_CONTACT_STR("Radio Phone Number", item->contact->radio_phone);
2809 MALLOC_CONTACT(item);
2810 LIST_COPY(item->contact->radio_phone, (char*));
2811 DEBUG_EMAIL(("%s\n", item->contact->radio_phone));
2812 break; 2532 break;
2813 case 0x3A1E: // PR_CAR_TELEPHONE_NUMBER 2533 case 0x3A1E: // PR_CAR_TELEPHONE_NUMBER
2814 DEBUG_EMAIL(("Car Phone Number - ")); 2534 LIST_COPY_CONTACT_STR("Car Phone Number", item->contact->car_phone);
2815 MALLOC_CONTACT(item);
2816 LIST_COPY(item->contact->car_phone, (char*));
2817 DEBUG_EMAIL(("%s\n", item->contact->car_phone));
2818 break; 2535 break;
2819 case 0x3A1F: // PR_OTHER_TELEPHONE_NUMBER 2536 case 0x3A1F: // PR_OTHER_TELEPHONE_NUMBER
2820 DEBUG_EMAIL(("Other Phone Number - ")); 2537 LIST_COPY_CONTACT_STR("Other Phone Number", item->contact->other_phone);
2821 MALLOC_CONTACT(item);
2822 LIST_COPY(item->contact->other_phone, (char*));
2823 DEBUG_EMAIL(("%s\n", item->contact->other_phone));
2824 break; 2538 break;
2825 case 0x3A20: // PR_TRANSMITTABLE_DISPLAY_NAME 2539 case 0x3A20: // PR_TRANSMITTABLE_DISPLAY_NAME
2826 DEBUG_EMAIL(("Transmittable Display Name - ")); 2540 LIST_COPY_CONTACT_STR("Transmittable Display Name", item->contact->transmittable_display_name);
2827 MALLOC_CONTACT(item);
2828 LIST_COPY(item->contact->transmittable_display_name, (char*));
2829 DEBUG_EMAIL(("%s\n", item->contact->transmittable_display_name));
2830 break; 2541 break;
2831 case 0x3A21: // PR_PAGER_TELEPHONE_NUMBER 2542 case 0x3A21: // PR_PAGER_TELEPHONE_NUMBER
2832 DEBUG_EMAIL(("Pager Phone Number - ")); 2543 LIST_COPY_CONTACT_STR("Pager Phone Number", item->contact->pager_phone);
2833 MALLOC_CONTACT(item);
2834 LIST_COPY(item->contact->pager_phone, (char*));
2835 DEBUG_EMAIL(("%s\n", item->contact->pager_phone));
2836 break; 2544 break;
2837 case 0x3A22: // PR_USER_CERTIFICATE 2545 case 0x3A22: // PR_USER_CERTIFICATE
2838 DEBUG_EMAIL(("User Certificate - NOT PROCESSED")); 2546 DEBUG_EMAIL(("User Certificate - NOT PROCESSED"));
2839 break; 2547 break;
2840 case 0x3A23: // PR_PRIMARY_FAX_NUMBER 2548 case 0x3A23: // PR_PRIMARY_FAX_NUMBER
2841 DEBUG_EMAIL(("Primary Fax Number - ")); 2549 LIST_COPY_CONTACT_STR("Primary Fax Number", item->contact->primary_fax);
2842 MALLOC_CONTACT(item);
2843 LIST_COPY(item->contact->primary_fax, (char*));
2844 DEBUG_EMAIL(("%s\n", item->contact->primary_fax));
2845 break; 2550 break;
2846 case 0x3A24: // PR_BUSINESS_FAX_NUMBER 2551 case 0x3A24: // PR_BUSINESS_FAX_NUMBER
2847 DEBUG_EMAIL(("Business Fax Number - ")); 2552 LIST_COPY_CONTACT_STR("Business Fax Number", item->contact->business_fax);
2848 MALLOC_CONTACT(item);
2849 LIST_COPY(item->contact->business_fax, (char*));
2850 DEBUG_EMAIL(("%s\n", item->contact->business_fax));
2851 break; 2553 break;
2852 case 0x3A25: // PR_HOME_FAX_NUMBER 2554 case 0x3A25: // PR_HOME_FAX_NUMBER
2853 DEBUG_EMAIL(("Home Fax Number - ")); 2555 LIST_COPY_CONTACT_STR("Home Fax Number", item->contact->home_fax);
2854 MALLOC_CONTACT(item);
2855 LIST_COPY(item->contact->home_fax, (char*));
2856 DEBUG_EMAIL(("%s\n", item->contact->home_fax));
2857 break; 2556 break;
2858 case 0x3A26: // PR_BUSINESS_ADDRESS_COUNTRY 2557 case 0x3A26: // PR_BUSINESS_ADDRESS_COUNTRY
2859 DEBUG_EMAIL(("Business Address Country - ")); 2558 LIST_COPY_CONTACT_STR("Business Address Country", item->contact->business_country);
2860 MALLOC_CONTACT(item);
2861 LIST_COPY(item->contact->business_country, (char*));
2862 DEBUG_EMAIL(("%s\n", item->contact->business_country));
2863 break; 2559 break;
2864 case 0x3A27: // PR_BUSINESS_ADDRESS_CITY 2560 case 0x3A27: // PR_BUSINESS_ADDRESS_CITY
2865 DEBUG_EMAIL(("Business Address City - ")); 2561 LIST_COPY_CONTACT_STR("Business Address City", item->contact->business_city);
2866 MALLOC_CONTACT(item);
2867 LIST_COPY(item->contact->business_city, (char*));
2868 DEBUG_EMAIL(("%s\n", item->contact->business_city));
2869 break; 2562 break;
2870 case 0x3A28: // PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE 2563 case 0x3A28: // PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE
2871 DEBUG_EMAIL(("Business Address State - ")); 2564 LIST_COPY_CONTACT_STR("Business Address State", item->contact->business_state);
2872 MALLOC_CONTACT(item);
2873 LIST_COPY(item->contact->business_state, (char*));
2874 DEBUG_EMAIL(("%s\n", item->contact->business_state));
2875 break; 2565 break;
2876 case 0x3A29: // PR_BUSINESS_ADDRESS_STREET 2566 case 0x3A29: // PR_BUSINESS_ADDRESS_STREET
2877 DEBUG_EMAIL(("Business Address Street - ")); 2567 LIST_COPY_CONTACT_STR("Business Address Street", item->contact->business_street);
2878 MALLOC_CONTACT(item);
2879 LIST_COPY(item->contact->business_street, (char*));
2880 DEBUG_EMAIL(("%s\n", item->contact->business_street));
2881 break; 2568 break;
2882 case 0x3A2A: // PR_BUSINESS_POSTAL_CODE 2569 case 0x3A2A: // PR_BUSINESS_POSTAL_CODE
2883 DEBUG_EMAIL(("Business Postal Code - ")); 2570 LIST_COPY_CONTACT_STR("Business Postal Code", item->contact->business_postal_code);
2884 MALLOC_CONTACT(item);
2885 LIST_COPY(item->contact->business_postal_code, (char*));
2886 DEBUG_EMAIL(("%s\n", item->contact->business_postal_code));
2887 break; 2571 break;
2888 case 0x3A2B: // PR_BUSINESS_PO_BOX 2572 case 0x3A2B: // PR_BUSINESS_PO_BOX
2889 DEBUG_EMAIL(("Business PO Box - ")); 2573 LIST_COPY_CONTACT_STR("Business PO Box", item->contact->business_po_box);
2890 MALLOC_CONTACT(item);
2891 LIST_COPY(item->contact->business_po_box, (char*));
2892 DEBUG_EMAIL(("%s\n", item->contact->business_po_box));
2893 break; 2574 break;
2894 case 0x3A2C: // PR_TELEX_NUMBER 2575 case 0x3A2C: // PR_TELEX_NUMBER
2895 DEBUG_EMAIL(("Telex Number - ")); 2576 LIST_COPY_CONTACT_STR("Telex Number", item->contact->telex);
2896 MALLOC_CONTACT(item);
2897 LIST_COPY(item->contact->telex, (char*));
2898 DEBUG_EMAIL(("%s\n", item->contact->telex));
2899 break; 2577 break;
2900 case 0x3A2D: // PR_ISDN_NUMBER 2578 case 0x3A2D: // PR_ISDN_NUMBER
2901 DEBUG_EMAIL(("ISDN Number - ")); 2579 LIST_COPY_CONTACT_STR("ISDN Number", item->contact->isdn_phone);
2902 MALLOC_CONTACT(item);
2903 LIST_COPY(item->contact->isdn_phone, (char*));
2904 DEBUG_EMAIL(("%s\n", item->contact->isdn_phone));
2905 break; 2580 break;
2906 case 0x3A2E: // PR_ASSISTANT_TELEPHONE_NUMBER 2581 case 0x3A2E: // PR_ASSISTANT_TELEPHONE_NUMBER
2907 DEBUG_EMAIL(("Assistant Phone Number - ")); 2582 LIST_COPY_CONTACT_STR("Assistant Phone Number", item->contact->assistant_phone);
2908 MALLOC_CONTACT(item);
2909 LIST_COPY(item->contact->assistant_phone, (char*));
2910 DEBUG_EMAIL(("%s\n", item->contact->assistant_phone));
2911 break; 2583 break;
2912 case 0x3A2F: // PR_HOME2_TELEPHONE_NUMBER 2584 case 0x3A2F: // PR_HOME2_TELEPHONE_NUMBER
2913 DEBUG_EMAIL(("Home Phone 2 - ")); 2585 LIST_COPY_CONTACT_STR("Home Phone 2", item->contact->home_phone2);
2914 MALLOC_CONTACT(item);
2915 LIST_COPY(item->contact->home_phone2, (char*));
2916 DEBUG_EMAIL(("%s\n", item->contact->home_phone2));
2917 break; 2586 break;
2918 case 0x3A30: // PR_ASSISTANT 2587 case 0x3A30: // PR_ASSISTANT
2919 DEBUG_EMAIL(("Assistant's Name - ")); 2588 LIST_COPY_CONTACT_STR("Assistant's Name", item->contact->assistant_name);
2920 MALLOC_CONTACT(item);
2921 LIST_COPY(item->contact->assistant_name, (char*));
2922 DEBUG_EMAIL(("%s\n", item->contact->assistant_name));
2923 break; 2589 break;
2924 case 0x3A40: // PR_SEND_RICH_INFO 2590 case 0x3A40: // PR_SEND_RICH_INFO
2925 DEBUG_EMAIL(("Can receive Rich Text - ")); 2591 LIST_COPY_CONTACT_BOOL("Can receive Rich Text", item->contact->rich_text);
2926 MALLOC_CONTACT(item);
2927 if (*(int16_t*)list->items[x]->data) {
2928 DEBUG_EMAIL(("True\n"));
2929 item->contact->rich_text = 1;
2930 } else {
2931 DEBUG_EMAIL(("False\n"));
2932 item->contact->rich_text = 0;
2933 }
2934 break; 2592 break;
2935 case 0x3A41: // PR_WEDDING_ANNIVERSARY 2593 case 0x3A41: // PR_WEDDING_ANNIVERSARY
2936 DEBUG_EMAIL(("Wedding Anniversary - ")); 2594 DEBUG_EMAIL(("Wedding Anniversary - "));
2937 MALLOC_CONTACT(item); 2595 MALLOC_CONTACT(item);
2938 LIST_COPY_TIME(item->contact->wedding_anniversary); 2596 LIST_COPY_TIME(item->contact->wedding_anniversary);
2943 MALLOC_CONTACT(item); 2601 MALLOC_CONTACT(item);
2944 LIST_COPY_TIME(item->contact->birthday); 2602 LIST_COPY_TIME(item->contact->birthday);
2945 DEBUG_EMAIL(("%s\n", fileTimeToAscii(item->contact->birthday))); 2603 DEBUG_EMAIL(("%s\n", fileTimeToAscii(item->contact->birthday)));
2946 break; 2604 break;
2947 case 0x3A43: // PR_HOBBIES 2605 case 0x3A43: // PR_HOBBIES
2948 DEBUG_EMAIL(("Hobbies - ")); 2606 LIST_COPY_CONTACT_STR("Hobbies", item->contact->hobbies);
2949 MALLOC_CONTACT(item);
2950 LIST_COPY(item->contact->hobbies, (char*));
2951 DEBUG_EMAIL(("%s\n", item->contact->hobbies));
2952 break; 2607 break;
2953 case 0x3A44: // PR_MIDDLE_NAME 2608 case 0x3A44: // PR_MIDDLE_NAME
2954 DEBUG_EMAIL(("Middle Name - ")); 2609 LIST_COPY_CONTACT_STR("Middle Name", item->contact->middle_name);
2955 MALLOC_CONTACT(item);
2956 LIST_COPY(item->contact->middle_name, (char*));
2957 DEBUG_EMAIL(("%s\n", item->contact->middle_name));
2958 break; 2610 break;
2959 case 0x3A45: // PR_DISPLAY_NAME_PREFIX 2611 case 0x3A45: // PR_DISPLAY_NAME_PREFIX
2960 DEBUG_EMAIL(("Display Name Prefix (Title) - ")); 2612 LIST_COPY_CONTACT_STR("Display Name Prefix (Title)", item->contact->display_name_prefix);
2961 MALLOC_CONTACT(item);
2962 LIST_COPY(item->contact->display_name_prefix, (char*));
2963 DEBUG_EMAIL(("%s\n", item->contact->display_name_prefix));
2964 break; 2613 break;
2965 case 0x3A46: // PR_PROFESSION 2614 case 0x3A46: // PR_PROFESSION
2966 DEBUG_EMAIL(("Profession - ")); 2615 LIST_COPY_CONTACT_STR("Profession", item->contact->profession);
2967 MALLOC_CONTACT(item);
2968 LIST_COPY(item->contact->profession, (char*));
2969 DEBUG_EMAIL(("%s\n", item->contact->profession));
2970 break; 2616 break;
2971 case 0x3A47: // PR_PREFERRED_BY_NAME 2617 case 0x3A47: // PR_PREFERRED_BY_NAME
2972 DEBUG_EMAIL(("Preferred By Name - ")); 2618 LIST_COPY_CONTACT_STR("Preferred By Name", item->contact->pref_name);
2973 MALLOC_CONTACT(item);
2974 LIST_COPY(item->contact->pref_name, (char*));
2975 DEBUG_EMAIL(("%s\n", item->contact->pref_name));
2976 break; 2619 break;
2977 case 0x3A48: // PR_SPOUSE_NAME 2620 case 0x3A48: // PR_SPOUSE_NAME
2978 DEBUG_EMAIL(("Spouse's Name - ")); 2621 LIST_COPY_CONTACT_STR("Spouse's Name", item->contact->spouse_name);
2979 MALLOC_CONTACT(item);
2980 LIST_COPY(item->contact->spouse_name, (char*));
2981 DEBUG_EMAIL(("%s\n", item->contact->spouse_name));
2982 break; 2622 break;
2983 case 0x3A49: // PR_COMPUTER_NETWORK_NAME 2623 case 0x3A49: // PR_COMPUTER_NETWORK_NAME
2984 DEBUG_EMAIL(("Computer Network Name - ")); 2624 LIST_COPY_CONTACT_STR("Computer Network Name", item->contact->computer_name);
2985 MALLOC_CONTACT(item);
2986 LIST_COPY(item->contact->computer_name, (char*));
2987 DEBUG_EMAIL(("%s\n", item->contact->computer_name));
2988 break; 2625 break;
2989 case 0x3A4A: // PR_CUSTOMER_ID 2626 case 0x3A4A: // PR_CUSTOMER_ID
2990 DEBUG_EMAIL(("Customer ID - ")); 2627 LIST_COPY_CONTACT_STR("Customer ID", item->contact->customer_id);
2991 MALLOC_CONTACT(item);
2992 LIST_COPY(item->contact->customer_id, (char*));
2993 DEBUG_EMAIL(("%s\n", item->contact->customer_id));
2994 break; 2628 break;
2995 case 0x3A4B: // PR_TTYTDD_PHONE_NUMBER 2629 case 0x3A4B: // PR_TTYTDD_PHONE_NUMBER
2996 DEBUG_EMAIL(("TTY/TDD Phone - ")); 2630 LIST_COPY_CONTACT_STR("TTY/TDD Phone", item->contact->ttytdd_phone);
2997 MALLOC_CONTACT(item);
2998 LIST_COPY(item->contact->ttytdd_phone, (char*));
2999 DEBUG_EMAIL(("%s\n", item->contact->ttytdd_phone));
3000 break; 2631 break;
3001 case 0x3A4C: // PR_FTP_SITE 2632 case 0x3A4C: // PR_FTP_SITE
3002 DEBUG_EMAIL(("Ftp Site - ")); 2633 LIST_COPY_CONTACT_STR("Ftp Site", item->contact->ftp_site);
3003 MALLOC_CONTACT(item);
3004 LIST_COPY(item->contact->ftp_site, (char*));
3005 DEBUG_EMAIL(("%s\n", item->contact->ftp_site));
3006 break; 2634 break;
3007 case 0x3A4D: // PR_GENDER 2635 case 0x3A4D: // PR_GENDER
3008 DEBUG_EMAIL(("Gender - ")); 2636 DEBUG_EMAIL(("Gender - "));
3009 MALLOC_CONTACT(item); 2637 MALLOC_CONTACT(item);
3010 memcpy(&item->contact->gender, list->items[x]->data, sizeof(item->contact->gender)); 2638 memcpy(&item->contact->gender, list->items[x]->data, sizeof(item->contact->gender));
3022 default: 2650 default:
3023 DEBUG_EMAIL(("Error processing\n")); 2651 DEBUG_EMAIL(("Error processing\n"));
3024 } 2652 }
3025 break; 2653 break;
3026 case 0x3A4E: // PR_MANAGER_NAME 2654 case 0x3A4E: // PR_MANAGER_NAME
3027 DEBUG_EMAIL(("Manager's Name - ")); 2655 LIST_COPY_CONTACT_STR("Manager's Name", item->contact->manager_name);
3028 MALLOC_CONTACT(item);
3029 LIST_COPY(item->contact->manager_name, (char*));
3030 DEBUG_EMAIL(("%s\n", item->contact->manager_name));
3031 break; 2656 break;
3032 case 0x3A4F: // PR_NICKNAME 2657 case 0x3A4F: // PR_NICKNAME
3033 DEBUG_EMAIL(("Nickname - ")); 2658 LIST_COPY_CONTACT_STR("Nickname", item->contact->nickname);
3034 MALLOC_CONTACT(item);
3035 LIST_COPY(item->contact->nickname, (char*));
3036 DEBUG_EMAIL(("%s\n", item->contact->nickname));
3037 break; 2659 break;
3038 case 0x3A50: // PR_PERSONAL_HOME_PAGE 2660 case 0x3A50: // PR_PERSONAL_HOME_PAGE
3039 DEBUG_EMAIL(("Personal Home Page - ")); 2661 LIST_COPY_CONTACT_STR("Personal Home Page", item->contact->personal_homepage);
3040 MALLOC_CONTACT(item);
3041 LIST_COPY(item->contact->personal_homepage, (char*));
3042 DEBUG_EMAIL(("%s\n", item->contact->personal_homepage));
3043 break; 2662 break;
3044 case 0x3A51: // PR_BUSINESS_HOME_PAGE 2663 case 0x3A51: // PR_BUSINESS_HOME_PAGE
3045 DEBUG_EMAIL(("Business Home Page - ")); 2664 LIST_COPY_CONTACT_STR("Business Home Page", item->contact->business_homepage);
3046 MALLOC_CONTACT(item);
3047 LIST_COPY(item->contact->business_homepage, (char*));
3048 DEBUG_EMAIL(("%s\n", item->contact->business_homepage));
3049 break; 2665 break;
3050 case 0x3A57: // PR_COMPANY_MAIN_PHONE_NUMBER 2666 case 0x3A57: // PR_COMPANY_MAIN_PHONE_NUMBER
3051 DEBUG_EMAIL(("Company Main Phone - ")); 2667 LIST_COPY_CONTACT_STR("Company Main Phone", item->contact->company_main_phone);
3052 MALLOC_CONTACT(item);
3053 LIST_COPY(item->contact->company_main_phone, (char*));
3054 DEBUG_EMAIL(("%s\n", item->contact->company_main_phone));
3055 break; 2668 break;
3056 case 0x3A58: // PR_CHILDRENS_NAMES 2669 case 0x3A58: // PR_CHILDRENS_NAMES
3057 DEBUG_EMAIL(("Children's Names - NOT PROCESSED\n")); 2670 DEBUG_EMAIL(("Children's Names - NOT PROCESSED\n"));
3058 break; 2671 break;
3059 case 0x3A59: // PR_HOME_ADDRESS_CITY 2672 case 0x3A59: // PR_HOME_ADDRESS_CITY
3060 DEBUG_EMAIL(("Home Address City - ")); 2673 LIST_COPY_CONTACT_STR("Home Address City", item->contact->home_city);
3061 MALLOC_CONTACT(item);
3062 LIST_COPY(item->contact->home_city, (char*));
3063 DEBUG_EMAIL(("%s\n", item->contact->home_city));
3064 break; 2674 break;
3065 case 0x3A5A: // PR_HOME_ADDRESS_COUNTRY 2675 case 0x3A5A: // PR_HOME_ADDRESS_COUNTRY
3066 DEBUG_EMAIL(("Home Address Country - ")); 2676 LIST_COPY_CONTACT_STR("Home Address Country", item->contact->home_country);
3067 MALLOC_CONTACT(item);
3068 LIST_COPY(item->contact->home_country, (char*));
3069 DEBUG_EMAIL(("%s\n", item->contact->home_country));
3070 break; 2677 break;
3071 case 0x3A5B: // PR_HOME_ADDRESS_POSTAL_CODE 2678 case 0x3A5B: // PR_HOME_ADDRESS_POSTAL_CODE
3072 DEBUG_EMAIL(("Home Address Postal Code - ")); 2679 LIST_COPY_CONTACT_STR("Home Address Postal Code", item->contact->home_postal_code);
3073 MALLOC_CONTACT(item);
3074 LIST_COPY(item->contact->home_postal_code, (char*));
3075 DEBUG_EMAIL(("%s\n", item->contact->home_postal_code));
3076 break; 2680 break;
3077 case 0x3A5C: // PR_HOME_ADDRESS_STATE_OR_PROVINCE 2681 case 0x3A5C: // PR_HOME_ADDRESS_STATE_OR_PROVINCE
3078 DEBUG_EMAIL(("Home Address State or Province - ")); 2682 LIST_COPY_CONTACT_STR("Home Address State or Province", item->contact->home_state);
3079 MALLOC_CONTACT(item);
3080 LIST_COPY(item->contact->home_state, (char*));
3081 DEBUG_EMAIL(("%s\n", item->contact->home_state));
3082 break; 2683 break;
3083 case 0x3A5D: // PR_HOME_ADDRESS_STREET 2684 case 0x3A5D: // PR_HOME_ADDRESS_STREET
3084 DEBUG_EMAIL(("Home Address Street - ")); 2685 LIST_COPY_CONTACT_STR("Home Address Street", item->contact->home_street);
3085 MALLOC_CONTACT(item);
3086 LIST_COPY(item->contact->home_street, (char*));
3087 DEBUG_EMAIL(("%s\n", item->contact->home_street));
3088 break; 2686 break;
3089 case 0x3A5E: // PR_HOME_ADDRESS_POST_OFFICE_BOX 2687 case 0x3A5E: // PR_HOME_ADDRESS_POST_OFFICE_BOX
3090 DEBUG_EMAIL(("Home Address Post Office Box - ")); 2688 LIST_COPY_CONTACT_STR("Home Address Post Office Box", item->contact->home_po_box);
3091 MALLOC_CONTACT(item);
3092 LIST_COPY(item->contact->home_po_box, (char*));
3093 DEBUG_EMAIL(("%s\n", item->contact->home_po_box));
3094 break; 2689 break;
3095 case 0x3A5F: // PR_OTHER_ADDRESS_CITY 2690 case 0x3A5F: // PR_OTHER_ADDRESS_CITY
3096 DEBUG_EMAIL(("Other Address City - ")); 2691 LIST_COPY_CONTACT_STR("Other Address City", item->contact->other_city);
3097 MALLOC_CONTACT(item);
3098 LIST_COPY(item->contact->other_city, (char*));
3099 DEBUG_EMAIL(("%s\n", item->contact->other_city));
3100 break; 2692 break;
3101 case 0x3A60: // PR_OTHER_ADDRESS_COUNTRY 2693 case 0x3A60: // PR_OTHER_ADDRESS_COUNTRY
3102 DEBUG_EMAIL(("Other Address Country - ")); 2694 LIST_COPY_CONTACT_STR("Other Address Country", item->contact->other_country);
3103 MALLOC_CONTACT(item);
3104 LIST_COPY(item->contact->other_country, (char*));
3105 DEBUG_EMAIL(("%s\n", item->contact->other_country));
3106 break; 2695 break;
3107 case 0x3A61: // PR_OTHER_ADDRESS_POSTAL_CODE 2696 case 0x3A61: // PR_OTHER_ADDRESS_POSTAL_CODE
3108 DEBUG_EMAIL(("Other Address Postal Code - ")); 2697 LIST_COPY_CONTACT_STR("Other Address Postal Code", item->contact->other_postal_code);
3109 MALLOC_CONTACT(item);
3110 LIST_COPY(item->contact->other_postal_code, (char*));
3111 DEBUG_EMAIL(("%s\n", item->contact->other_postal_code));
3112 break; 2698 break;
3113 case 0x3A62: // PR_OTHER_ADDRESS_STATE_OR_PROVINCE 2699 case 0x3A62: // PR_OTHER_ADDRESS_STATE_OR_PROVINCE
3114 DEBUG_EMAIL(("Other Address State - ")); 2700 LIST_COPY_CONTACT_STR("Other Address State", item->contact->other_state);
3115 MALLOC_CONTACT(item);
3116 LIST_COPY(item->contact->other_state, (char*));
3117 DEBUG_EMAIL(("%s\n", item->contact->other_state));
3118 break; 2701 break;
3119 case 0x3A63: // PR_OTHER_ADDRESS_STREET 2702 case 0x3A63: // PR_OTHER_ADDRESS_STREET
3120 DEBUG_EMAIL(("Other Address Street - ")); 2703 LIST_COPY_CONTACT_STR("Other Address Street", item->contact->other_street);
3121 MALLOC_CONTACT(item);
3122 LIST_COPY(item->contact->other_street, (char*));
3123 DEBUG_EMAIL(("%s\n", item->contact->other_street));
3124 break; 2704 break;
3125 case 0x3A64: // PR_OTHER_ADDRESS_POST_OFFICE_BOX 2705 case 0x3A64: // PR_OTHER_ADDRESS_POST_OFFICE_BOX
3126 DEBUG_EMAIL(("Other Address Post Office box - ")); 2706 LIST_COPY_CONTACT_STR("Other Address Post Office box", item->contact->other_po_box);
3127 MALLOC_CONTACT(item);
3128 LIST_COPY(item->contact->other_po_box, (char*));
3129 DEBUG_EMAIL(("%s\n", item->contact->other_po_box));
3130 break; 2707 break;
3131 case 0x3FDE: // PR_INTERNET_CPID 2708 case 0x3FDE: // PR_INTERNET_CPID
3132 memcpy(&(item->internet_cpid), list->items[x]->data, sizeof(item->internet_cpid)); 2709 memcpy(&(item->internet_cpid), list->items[x]->data, sizeof(item->internet_cpid));
3133 LE32_CPU(item->internet_cpid); 2710 LE32_CPU(item->internet_cpid);
3134 t = item->internet_cpid; 2711 t = item->internet_cpid;
3189 LE32_CPU(item->message_store->top_of_folder->id); 2766 LE32_CPU(item->message_store->top_of_folder->id);
3190 DEBUG_EMAIL(("u1 %#x id %#x\n", item->message_store->top_of_folder->u1, item->message_store->top_of_folder->id)); 2767 DEBUG_EMAIL(("u1 %#x id %#x\n", item->message_store->top_of_folder->u1, item->message_store->top_of_folder->id));
3191 DEBUG_EMAIL_HEXPRINT((char*)item->message_store->top_of_folder->entryid, 16); 2768 DEBUG_EMAIL_HEXPRINT((char*)item->message_store->top_of_folder->entryid, 16);
3192 break; 2769 break;
3193 case 0x8005: // Contact's Fullname 2770 case 0x8005: // Contact's Fullname
3194 DEBUG_EMAIL(("Contact Fullname - ")); 2771 LIST_COPY_CONTACT_STR("Contact Fullname", item->contact->fullname);
3195 MALLOC_CONTACT(item);
3196 LIST_COPY(item->contact->fullname, (char*));
3197 DEBUG_EMAIL(("%s\n", item->contact->fullname));
3198 break; 2772 break;
3199 case 0x801A: // Full Home Address 2773 case 0x801A: // Full Home Address
3200 DEBUG_EMAIL(("Home Address - ")); 2774 LIST_COPY_CONTACT_STR("Home Address", item->contact->home_address);
3201 MALLOC_CONTACT(item);
3202 LIST_COPY(item->contact->home_address, (char*));
3203 DEBUG_EMAIL(("%s\n", item->contact->home_address));
3204 break; 2775 break;
3205 case 0x801B: // Full Business Address 2776 case 0x801B: // Full Business Address
3206 DEBUG_EMAIL(("Business Address - ")); 2777 LIST_COPY_CONTACT_STR("Business Address", item->contact->business_address);
3207 MALLOC_CONTACT(item);
3208 LIST_COPY(item->contact->business_address, (char*));
3209 DEBUG_EMAIL(("%s\n", item->contact->business_address));
3210 break; 2778 break;
3211 case 0x801C: // Full Other Address 2779 case 0x801C: // Full Other Address
3212 DEBUG_EMAIL(("Other Address - ")); 2780 LIST_COPY_CONTACT_STR("Other Address", item->contact->other_address);
3213 MALLOC_CONTACT(item);
3214 LIST_COPY(item->contact->other_address, (char*));
3215 DEBUG_EMAIL(("%s\n", item->contact->other_address));
3216 break; 2781 break;
3217 case 0x8045: // Work address street 2782 case 0x8045: // Work address street
3218 DEBUG_EMAIL(("Work address street - ")); 2783 LIST_COPY_CONTACT_STR("Work address street", item->contact->work_address_street);
3219 MALLOC_CONTACT(item);
3220 LIST_COPY(item->contact->work_address_street, (char*));
3221 DEBUG_EMAIL(("%s\n", item->contact->work_address_street));
3222 break; 2784 break;
3223 case 0x8046: // Work address city 2785 case 0x8046: // Work address city
3224 DEBUG_EMAIL(("Work address city - ")); 2786 LIST_COPY_CONTACT_STR("Work address city", item->contact->work_address_city);
3225 MALLOC_CONTACT(item);
3226 LIST_COPY(item->contact->work_address_city, (char*));
3227 DEBUG_EMAIL(("%s\n", item->contact->work_address_city));
3228 break; 2787 break;
3229 case 0x8047: // Work address state 2788 case 0x8047: // Work address state
3230 DEBUG_EMAIL(("Work address state - ")); 2789 LIST_COPY_CONTACT_STR("Work address state", item->contact->work_address_state);
3231 MALLOC_CONTACT(item);
3232 LIST_COPY(item->contact->work_address_state, (char*));
3233 DEBUG_EMAIL(("%s\n", item->contact->work_address_state));
3234 break; 2790 break;
3235 case 0x8048: // Work address postalcode 2791 case 0x8048: // Work address postalcode
3236 DEBUG_EMAIL(("Work address postalcode - ")); 2792 LIST_COPY_CONTACT_STR("Work address postalcode", item->contact->work_address_postalcode);
3237 MALLOC_CONTACT(item);
3238 LIST_COPY(item->contact->work_address_postalcode, (char*));
3239 DEBUG_EMAIL(("%s\n", item->contact->work_address_postalcode));
3240 break; 2793 break;
3241 case 0x8049: // Work address country 2794 case 0x8049: // Work address country
3242 DEBUG_EMAIL(("Work address country - ")); 2795 LIST_COPY_CONTACT_STR("Work address country", item->contact->work_address_country);
3243 MALLOC_CONTACT(item);
3244 LIST_COPY(item->contact->work_address_country, (char*));
3245 DEBUG_EMAIL(("%s\n", item->contact->work_address_country));
3246 break; 2796 break;
3247 case 0x804A: // Work address postofficebox 2797 case 0x804A: // Work address postofficebox
3248 DEBUG_EMAIL(("Work address postofficebox - ")); 2798 LIST_COPY_CONTACT_STR("Work address postofficebox", item->contact->work_address_postofficebox);
3249 MALLOC_CONTACT(item);
3250 LIST_COPY(item->contact->work_address_postofficebox, (char*));
3251 DEBUG_EMAIL(("%s\n", item->contact->work_address_postofficebox));
3252 break; 2799 break;
3253 case 0x8082: // Email Address 1 Transport 2800 case 0x8082: // Email Address 1 Transport
3254 DEBUG_EMAIL(("Email Address 1 Transport - ")); 2801 LIST_COPY_CONTACT_STR("Email Address 1 Transport", item->contact->address1_transport);
3255 MALLOC_CONTACT(item);
3256 LIST_COPY(item->contact->address1_transport, (char*));
3257 DEBUG_EMAIL(("|%s|\n", item->contact->address1_transport));
3258 break; 2802 break;
3259 case 0x8083: // Email Address 1 Address 2803 case 0x8083: // Email Address 1 Address
3260 DEBUG_EMAIL(("Email Address 1 Address - ")); 2804 LIST_COPY_CONTACT_STR("Email Address 1 Address", item->contact->address1);
3261 MALLOC_CONTACT(item);
3262 LIST_COPY(item->contact->address1, (char*));
3263 DEBUG_EMAIL(("|%s|\n", item->contact->address1));
3264 break; 2805 break;
3265 case 0x8084: // Email Address 1 Description 2806 case 0x8084: // Email Address 1 Description
3266 DEBUG_EMAIL(("Email Address 1 Description - ")); 2807 LIST_COPY_CONTACT_STR("Email Address 1 Description", item->contact->address1_desc);
3267 MALLOC_CONTACT(item);
3268 LIST_COPY(item->contact->address1_desc, (char*));
3269 DEBUG_EMAIL(("|%s|\n", item->contact->address1_desc));
3270 break; 2808 break;
3271 case 0x8085: // Email Address 1 Record 2809 case 0x8085: // Email Address 1 Record
3272 DEBUG_EMAIL(("Email Address 1 Record - ")); 2810 LIST_COPY_CONTACT_STR("Email Address 1 Record", item->contact->address1a);
3273 MALLOC_CONTACT(item);
3274 LIST_COPY(item->contact->address1a, (char*));
3275 DEBUG_EMAIL(("|%s|\n", item->contact->address1a));
3276 break; 2811 break;
3277 case 0x8092: // Email Address 2 Transport 2812 case 0x8092: // Email Address 2 Transport
3278 DEBUG_EMAIL(("Email Address 2 Transport - ")); 2813 LIST_COPY_CONTACT_STR("Email Address 2 Transport", item->contact->address2_transport);
3279 MALLOC_CONTACT(item);
3280 LIST_COPY(item->contact->address2_transport, (char*));
3281 DEBUG_EMAIL(("|%s|\n", item->contact->address2_transport));
3282 break; 2814 break;
3283 case 0x8093: // Email Address 2 Address 2815 case 0x8093: // Email Address 2 Address
3284 DEBUG_EMAIL(("Email Address 2 Address - ")); 2816 LIST_COPY_CONTACT_STR("Email Address 2 Address", item->contact->address2);
3285 MALLOC_CONTACT(item);
3286 LIST_COPY(item->contact->address2, (char*));
3287 DEBUG_EMAIL(("|%s|\n", item->contact->address2));
3288 break; 2817 break;
3289 case 0x8094: // Email Address 2 Description 2818 case 0x8094: // Email Address 2 Description
3290 DEBUG_EMAIL (("Email Address 2 Description - ")); 2819 LIST_COPY_CONTACT_STR("Email Address 2 Description", item->contact->address2_desc);
3291 MALLOC_CONTACT(item);
3292 LIST_COPY(item->contact->address2_desc, (char*));
3293 DEBUG_EMAIL(("|%s|\n", item->contact->address2_desc));
3294 break; 2820 break;
3295 case 0x8095: // Email Address 2 Record 2821 case 0x8095: // Email Address 2 Record
3296 DEBUG_EMAIL(("Email Address 2 Record - ")); 2822 LIST_COPY_CONTACT_STR("Email Address 2 Record", item->contact->address2a);
3297 MALLOC_CONTACT(item);
3298 LIST_COPY(item->contact->address2a, (char*));
3299 DEBUG_EMAIL(("|%s|\n", item->contact->address2a));
3300 break; 2823 break;
3301 case 0x80A2: // Email Address 3 Transport 2824 case 0x80A2: // Email Address 3 Transport
3302 DEBUG_EMAIL (("Email Address 3 Transport - ")); 2825 LIST_COPY_CONTACT_STR("Email Address 3 Transport", item->contact->address3_transport);
3303 MALLOC_CONTACT(item);
3304 LIST_COPY(item->contact->address3_transport, (char*));
3305 DEBUG_EMAIL(("|%s|\n", item->contact->address3_transport));
3306 break; 2826 break;
3307 case 0x80A3: // Email Address 3 Address 2827 case 0x80A3: // Email Address 3 Address
3308 DEBUG_EMAIL(("Email Address 3 Address - ")); 2828 LIST_COPY_CONTACT_STR("Email Address 3 Address", item->contact->address3);
3309 MALLOC_CONTACT(item);
3310 LIST_COPY(item->contact->address3, (char*));
3311 DEBUG_EMAIL(("|%s|\n", item->contact->address3));
3312 break; 2829 break;
3313 case 0x80A4: // Email Address 3 Description 2830 case 0x80A4: // Email Address 3 Description
3314 DEBUG_EMAIL(("Email Address 3 Description - ")); 2831 LIST_COPY_CONTACT_STR("Email Address 3 Description", item->contact->address3_desc);
3315 MALLOC_CONTACT(item);
3316 LIST_COPY(item->contact->address3_desc, (char*));
3317 DEBUG_EMAIL(("|%s|\n", item->contact->address3_desc));
3318 break; 2832 break;
3319 case 0x80A5: // Email Address 3 Record 2833 case 0x80A5: // Email Address 3 Record
3320 DEBUG_EMAIL(("Email Address 3 Record - ")); 2834 LIST_COPY_CONTACT_STR("Email Address 3 Record", item->contact->address3a);
3321 MALLOC_CONTACT(item);
3322 LIST_COPY(item->contact->address3a, (char*));
3323 DEBUG_EMAIL(("|%s|\n", item->contact->address3a));
3324 break; 2835 break;
3325 case 0x80D8: // Internet Free/Busy 2836 case 0x80D8: // Internet Free/Busy
3326 DEBUG_EMAIL(("Internet Free/Busy - ")); 2837 LIST_COPY_CONTACT_STR("Internet Free/Busy", item->contact->free_busy_address);
3327 MALLOC_CONTACT(item);
3328 LIST_COPY(item->contact->free_busy_address, (char*));
3329 DEBUG_EMAIL(("%s\n", item->contact->free_busy_address));
3330 break; 2838 break;
3331 case 0x8205: // Show on Free/Busy as 2839 case 0x8205: // Show on Free/Busy as
3332 // 0: Free 2840 // 0: Free
3333 // 1: Tentative 2841 // 1: Tentative
3334 // 2: Busy 2842 // 2: Busy
3349 default: 2857 default:
3350 DEBUG_EMAIL(("Unknown Value: %d\n", item->appointment->showas)); break; 2858 DEBUG_EMAIL(("Unknown Value: %d\n", item->appointment->showas)); break;
3351 } 2859 }
3352 break; 2860 break;
3353 case 0x8208: // Location of an appointment 2861 case 0x8208: // Location of an appointment
3354 DEBUG_EMAIL(("Appointment Location - ")); 2862 LIST_COPY_APPT_STR("Appointment Location", item->appointment->location);
3355 MALLOC_APPOINTMENT(item);
3356 LIST_COPY(item->appointment->location, (char*));
3357 DEBUG_EMAIL(("%s\n", item->appointment->location));
3358 break; 2863 break;
3359 case 0x820d: // Appointment start 2864 case 0x820d: // Appointment start
3360 DEBUG_EMAIL(("Appointment Date Start - ")); 2865 DEBUG_EMAIL(("Appointment Date Start - "));
3361 MALLOC_APPOINTMENT(item); 2866 MALLOC_APPOINTMENT(item);
3362 LIST_COPY_TIME(item->appointment->start); 2867 LIST_COPY_TIME(item->appointment->start);
3397 case PST_APP_LABEL_PHONE_CALL: 2902 case PST_APP_LABEL_PHONE_CALL:
3398 DEBUG_EMAIL(("Phone Call\n")); break; 2903 DEBUG_EMAIL(("Phone Call\n")); break;
3399 } 2904 }
3400 break; 2905 break;
3401 case 0x8215: // All day appointment flag 2906 case 0x8215: // All day appointment flag
3402 DEBUG_EMAIL(("All day flag - ")); 2907 LIST_COPY_APPT_BOOL("All day flag", item->appointment->all_day);
3403 MALLOC_APPOINTMENT(item);
3404 if (*(int16_t*)list->items[x]->data) {
3405 DEBUG_EMAIL(("True\n"));
3406 item->appointment->all_day = 1;
3407 } else {
3408 DEBUG_EMAIL(("False\n"));
3409 item->appointment->all_day = 0;
3410 }
3411 break; 2908 break;
3412 case 0x8231: // Recurrence type 2909 case 0x8231: // Recurrence type
3413 // 1: Daily 2910 // 1: Daily
3414 // 2: Weekly 2911 // 2: Weekly
3415 // 3: Monthly 2912 // 3: Monthly
3430 default: 2927 default:
3431 DEBUG_EMAIL(("Unknown Value: %d\n", item->appointment->recurrence_type)); break; 2928 DEBUG_EMAIL(("Unknown Value: %d\n", item->appointment->recurrence_type)); break;
3432 } 2929 }
3433 break; 2930 break;
3434 case 0x8232: // Recurrence description 2931 case 0x8232: // Recurrence description
3435 DEBUG_EMAIL(("Appointment recurrence description - ")); 2932 LIST_COPY_APPT_STR("Appointment recurrence description", item->appointment->recurrence);
3436 MALLOC_APPOINTMENT(item);
3437 LIST_COPY(item->appointment->recurrence, (char*));
3438 DEBUG_EMAIL(("%s\n", item->appointment->recurrence));
3439 break; 2933 break;
3440 case 0x8234: // TimeZone as String 2934 case 0x8234: // TimeZone as String
3441 DEBUG_EMAIL(("TimeZone of times - ")); 2935 LIST_COPY_APPT_STR("TimeZone of times", item->appointment->timezonestring);
3442 MALLOC_APPOINTMENT(item);
3443 LIST_COPY(item->appointment->timezonestring, (char*));
3444 DEBUG_EMAIL(("%s\n", item->appointment->timezonestring));
3445 break; 2936 break;
3446 case 0x8235: // Recurrence start date 2937 case 0x8235: // Recurrence start date
3447 DEBUG_EMAIL(("Recurrence Start Date - ")); 2938 DEBUG_EMAIL(("Recurrence Start Date - "));
3448 MALLOC_APPOINTMENT(item); 2939 MALLOC_APPOINTMENT(item);
3449 LIST_COPY_TIME(item->appointment->recurrence_start); 2940 LIST_COPY_TIME(item->appointment->recurrence_start);
3461 memcpy(&(item->appointment->alarm_minutes), list->items[x]->data, sizeof(item->appointment->alarm_minutes)); 2952 memcpy(&(item->appointment->alarm_minutes), list->items[x]->data, sizeof(item->appointment->alarm_minutes));
3462 LE32_CPU(item->appointment->alarm_minutes); 2953 LE32_CPU(item->appointment->alarm_minutes);
3463 DEBUG_EMAIL(("%i\n", item->appointment->alarm_minutes)); 2954 DEBUG_EMAIL(("%i\n", item->appointment->alarm_minutes));
3464 break; 2955 break;
3465 case 0x8503: // Reminder alarm 2956 case 0x8503: // Reminder alarm
3466 DEBUG_EMAIL(("Reminder alarm - ")); 2957 LIST_COPY_APPT_BOOL("Reminder alarm", item->appointment->alarm);
3467 MALLOC_APPOINTMENT(item);
3468 if (*(int16_t*)list->items[x]->data) {
3469 DEBUG_EMAIL(("True\n"));
3470 item->appointment->alarm = 1;
3471 } else {
3472 DEBUG_EMAIL(("False\n"));
3473 item->appointment->alarm = 0;
3474 }
3475 break; 2958 break;
3476 case 0x8516: // Common start 2959 case 0x8516: // Common start
3477 DEBUG_EMAIL(("Common Start Date - ")); 2960 DEBUG_EMAIL(("Common Start Date - "));
3478 DEBUG_EMAIL(("%s\n", fileTimeToAscii((FILETIME*)list->items[x]->data))); 2961 DEBUG_EMAIL(("%s\n", fileTimeToAscii((FILETIME*)list->items[x]->data)));
3479 break; 2962 break;
3480 case 0x8517: // Common end 2963 case 0x8517: // Common end
3481 DEBUG_EMAIL(("Common End Date - ")); 2964 DEBUG_EMAIL(("Common End Date - "));
3482 DEBUG_EMAIL(("%s\n", fileTimeToAscii((FILETIME*)list->items[x]->data))); 2965 DEBUG_EMAIL(("%s\n", fileTimeToAscii((FILETIME*)list->items[x]->data)));
3483 break; 2966 break;
3484 case 0x851f: // Play reminder sound filename 2967 case 0x851f: // Play reminder sound filename
3485 DEBUG_EMAIL(("Appointment reminder sound filename - ")); 2968 LIST_COPY_APPT_STR("Appointment reminder sound filename", item->appointment->alarm_filename);
3486 MALLOC_APPOINTMENT(item);
3487 LIST_COPY(item->appointment->alarm_filename, (char*));
3488 DEBUG_EMAIL(("%s\n", item->appointment->alarm_filename));
3489 break; 2969 break;
3490 case 0x8530: // Followup 2970 case 0x8530: // Followup
3491 DEBUG_EMAIL(("Followup String - ")); 2971 LIST_COPY_CONTACT_STR("Followup String", item->contact->followup);
3492 MALLOC_CONTACT(item);
3493 LIST_COPY(item->contact->followup, (char*));
3494 DEBUG_EMAIL(("%s\n", item->contact->followup));
3495 break; 2972 break;
3496 case 0x8534: // Mileage 2973 case 0x8534: // Mileage
3497 DEBUG_EMAIL(("Mileage - ")); 2974 LIST_COPY_CONTACT_STR("Mileage", item->contact->mileage);
3498 MALLOC_CONTACT(item);
3499 LIST_COPY(item->contact->mileage, (char*));
3500 DEBUG_EMAIL(("%s\n", item->contact->mileage));
3501 break; 2975 break;
3502 case 0x8535: // Billing Information 2976 case 0x8535: // Billing Information
3503 DEBUG_EMAIL(("Billing Information - ")); 2977 LIST_COPY_CONTACT_STR("Billing Information", item->contact->billing_information);
3504 MALLOC_CONTACT(item);
3505 LIST_COPY(item->contact->billing_information, (char*));
3506 DEBUG_EMAIL(("%s\n", item->contact->billing_information));
3507 break; 2978 break;
3508 case 0x8554: // Outlook Version 2979 case 0x8554: // Outlook Version
3509 DEBUG_EMAIL(("Outlook Version - ")); 2980 LIST_COPY_STR("Outlook Version", item->outlook_version);
3510 LIST_COPY(item->outlook_version, (char*));
3511 DEBUG_EMAIL(("%s\n", item->outlook_version));
3512 break; 2981 break;
3513 case 0x8560: // Appointment Reminder Time 2982 case 0x8560: // Appointment Reminder Time
3514 DEBUG_EMAIL(("Appointment Reminder Time - ")); 2983 DEBUG_EMAIL(("Appointment Reminder Time - "));
3515 MALLOC_APPOINTMENT(item); 2984 MALLOC_APPOINTMENT(item);
3516 LIST_COPY_TIME(item->appointment->reminder); 2985 LIST_COPY_TIME(item->appointment->reminder);
3517 DEBUG_EMAIL(("%s\n", fileTimeToAscii(item->appointment->reminder))); 2986 DEBUG_EMAIL(("%s\n", fileTimeToAscii(item->appointment->reminder)));
3518 break; 2987 break;
3519 case 0x8700: // Journal Type 2988 case 0x8700: // Journal Type
3520 DEBUG_EMAIL(("Journal Entry Type - "));
3521 MALLOC_JOURNAL(item); 2989 MALLOC_JOURNAL(item);
3522 LIST_COPY(item->journal->type, (char*)); 2990 LIST_COPY_STR("Journal Entry Type", item->journal->type);
3523 DEBUG_EMAIL(("%s\n", item->journal->type));
3524 break; 2991 break;
3525 case 0x8706: // Journal Start date/time 2992 case 0x8706: // Journal Start date/time
3526 DEBUG_EMAIL(("Start Timestamp - ")); 2993 DEBUG_EMAIL(("Start Timestamp - "));
3527 MALLOC_JOURNAL(item); 2994 MALLOC_JOURNAL(item);
3528 LIST_COPY_TIME(item->journal->start); 2995 LIST_COPY_TIME(item->journal->start);
3533 MALLOC_JOURNAL(item); 3000 MALLOC_JOURNAL(item);
3534 LIST_COPY_TIME(item->journal->end); 3001 LIST_COPY_TIME(item->journal->end);
3535 DEBUG_EMAIL(("%s\n", fileTimeToAscii(item->journal->end))); 3002 DEBUG_EMAIL(("%s\n", fileTimeToAscii(item->journal->end)));
3536 break; 3003 break;
3537 case 0x8712: // Title? 3004 case 0x8712: // Title?
3538 DEBUG_EMAIL(("Journal Entry Type - "));
3539 MALLOC_JOURNAL(item); 3005 MALLOC_JOURNAL(item);
3540 LIST_COPY(item->journal->type, (char*)); 3006 LIST_COPY_STR("Journal Entry Type", item->journal->type);
3541 DEBUG_EMAIL(("%s\n", item->journal->type));
3542 break; 3007 break;
3543 default: 3008 default:
3544 if (list->items[x]->type == (uint32_t)0x0002) { 3009 if (list->items[x]->type == (uint32_t)0x0002) {
3545 DEBUG_EMAIL(("Unknown type %#x 16bit int = %hi\n", list->items[x]->id, 3010 DEBUG_EMAIL(("Unknown type %#x 16bit int = %hi\n", list->items[x]->id,
3546 *(int16_t*)list->items[x]->data)); 3011 *(int16_t*)list->items[x]->data));
3645 if (list->items[x]->data) { 3110 if (list->items[x]->data) {
3646 free(list->items[x]->data); 3111 free(list->items[x]->data);
3647 list->items[x]->data = NULL; 3112 list->items[x]->data = NULL;
3648 } 3113 }
3649 } 3114 }
3650 x++;
3651 } 3115 }
3652 list = list->next; 3116 list = list->next;
3653 if (attach) attach = attach->next; 3117 if (attach) attach = attach->next;
3654 } 3118 }
3655 DEBUG_RET(); 3119 DEBUG_RET();
3811 3275
3812 3276
3813 void pst_free_attach(pst_item_attach *attach) { 3277 void pst_free_attach(pst_item_attach *attach) {
3814 while (attach) { 3278 while (attach) {
3815 pst_item_attach *t; 3279 pst_item_attach *t;
3816 SAFE_FREE(attach->filename1); 3280 SAFE_FREE_STR(attach->filename1);
3817 SAFE_FREE(attach->filename2); 3281 SAFE_FREE_STR(attach->filename2);
3818 SAFE_FREE(attach->mimetype); 3282 SAFE_FREE_STR(attach->mimetype);
3819 SAFE_FREE(attach->data); 3283 SAFE_FREE(attach->data);
3820 pst_free_id2(attach->id2_head); 3284 pst_free_id2(attach->id2_head);
3821 t = attach->next; 3285 t = attach->next;
3822 free(attach); 3286 free(attach);
3823 attach = t; 3287 attach = t;
3830 3294
3831 DEBUG_ENT("pst_freeItem"); 3295 DEBUG_ENT("pst_freeItem");
3832 if (item) { 3296 if (item) {
3833 if (item->email) { 3297 if (item->email) {
3834 SAFE_FREE(item->email->arrival_date); 3298 SAFE_FREE(item->email->arrival_date);
3835 SAFE_FREE(item->email->body); 3299 SAFE_FREE_STR(item->email->cc_address);
3836 SAFE_FREE(item->email->cc_address); 3300 SAFE_FREE_STR(item->email->bcc_address);
3837 SAFE_FREE(item->email->bcc_address);
3838 SAFE_FREE(item->email->common_name);
3839 SAFE_FREE(item->email->encrypted_body); 3301 SAFE_FREE(item->email->encrypted_body);
3840 SAFE_FREE(item->email->encrypted_htmlbody); 3302 SAFE_FREE(item->email->encrypted_htmlbody);
3841 SAFE_FREE(item->email->header); 3303 SAFE_FREE_STR(item->email->header);
3842 SAFE_FREE(item->email->htmlbody); 3304 SAFE_FREE_STR(item->email->htmlbody);
3843 SAFE_FREE(item->email->in_reply_to); 3305 SAFE_FREE_STR(item->email->in_reply_to);
3844 SAFE_FREE(item->email->messageid); 3306 SAFE_FREE_STR(item->email->messageid);
3845 SAFE_FREE(item->email->original_bcc); 3307 SAFE_FREE_STR(item->email->original_bcc);
3846 SAFE_FREE(item->email->original_cc); 3308 SAFE_FREE_STR(item->email->original_cc);
3847 SAFE_FREE(item->email->original_to); 3309 SAFE_FREE_STR(item->email->original_to);
3848 SAFE_FREE(item->email->outlook_recipient); 3310 SAFE_FREE_STR(item->email->outlook_recipient);
3849 SAFE_FREE(item->email->outlook_recipient_name); 3311 SAFE_FREE_STR(item->email->outlook_recipient_name);
3850 SAFE_FREE(item->email->outlook_recipient2); 3312 SAFE_FREE_STR(item->email->outlook_recipient2);
3851 SAFE_FREE(item->email->outlook_sender); 3313 SAFE_FREE_STR(item->email->outlook_sender);
3852 SAFE_FREE(item->email->outlook_sender_name); 3314 SAFE_FREE_STR(item->email->outlook_sender_name);
3853 SAFE_FREE(item->email->outlook_sender2); 3315 SAFE_FREE_STR(item->email->outlook_sender2);
3854 SAFE_FREE(item->email->proc_subject); 3316 SAFE_FREE_STR(item->email->processed_subject);
3855 SAFE_FREE(item->email->recip_access); 3317 SAFE_FREE_STR(item->email->recip_access);
3856 SAFE_FREE(item->email->recip_address); 3318 SAFE_FREE_STR(item->email->recip_address);
3857 SAFE_FREE(item->email->recip2_access); 3319 SAFE_FREE_STR(item->email->recip2_access);
3858 SAFE_FREE(item->email->recip2_address); 3320 SAFE_FREE_STR(item->email->recip2_address);
3859 SAFE_FREE(item->email->reply_to); 3321 SAFE_FREE_STR(item->email->reply_to);
3860 SAFE_FREE(item->email->rtf_body_tag); 3322 SAFE_FREE_STR(item->email->rtf_body_tag);
3861 SAFE_FREE(item->email->rtf_compressed); 3323 SAFE_FREE(item->email->rtf_compressed);
3862 SAFE_FREE(item->email->return_path_address); 3324 SAFE_FREE_STR(item->email->return_path_address);
3863 SAFE_FREE(item->email->sender_access); 3325 SAFE_FREE_STR(item->email->sender_access);
3864 SAFE_FREE(item->email->sender_address); 3326 SAFE_FREE_STR(item->email->sender_address);
3865 SAFE_FREE(item->email->sender2_access); 3327 SAFE_FREE_STR(item->email->sender2_access);
3866 SAFE_FREE(item->email->sender2_address); 3328 SAFE_FREE_STR(item->email->sender2_address);
3867 SAFE_FREE(item->email->sent_date); 3329 SAFE_FREE(item->email->sent_date);
3868 SAFE_FREE(item->email->sentmail_folder); 3330 SAFE_FREE(item->email->sentmail_folder);
3869 SAFE_FREE(item->email->sentto_address); 3331 SAFE_FREE_STR(item->email->sentto_address);
3870 if (item->email->subject) 3332 SAFE_FREE_STR(item->email->report_text);
3871 SAFE_FREE(item->email->subject->subj);
3872 SAFE_FREE(item->email->subject);
3873 SAFE_FREE(item->email->report_text);
3874 SAFE_FREE(item->email->report_time); 3333 SAFE_FREE(item->email->report_time);
3875 SAFE_FREE(item->email->supplementary_info); 3334 SAFE_FREE_STR(item->email->supplementary_info);
3876 free(item->email); 3335 free(item->email);
3877 } 3336 }
3878 if (item->folder) { 3337 if (item->folder) {
3879 free(item->folder); 3338 free(item->folder);
3880 } 3339 }
3888 SAFE_FREE(item->message_store->search_root_folder); 3347 SAFE_FREE(item->message_store->search_root_folder);
3889 SAFE_FREE(item->message_store->top_of_folder); 3348 SAFE_FREE(item->message_store->top_of_folder);
3890 free(item->message_store); 3349 free(item->message_store);
3891 } 3350 }
3892 if (item->contact) { 3351 if (item->contact) {
3893 SAFE_FREE(item->contact->access_method); 3352 SAFE_FREE_STR(item->contact->access_method);
3894 SAFE_FREE(item->contact->account_name); 3353 SAFE_FREE_STR(item->contact->account_name);
3895 SAFE_FREE(item->contact->address1); 3354 SAFE_FREE_STR(item->contact->address1);
3896 SAFE_FREE(item->contact->address1a); 3355 SAFE_FREE_STR(item->contact->address1a);
3897 SAFE_FREE(item->contact->address1_desc); 3356 SAFE_FREE_STR(item->contact->address1_desc);
3898 SAFE_FREE(item->contact->address1_transport); 3357 SAFE_FREE_STR(item->contact->address1_transport);
3899 SAFE_FREE(item->contact->address2); 3358 SAFE_FREE_STR(item->contact->address2);
3900 SAFE_FREE(item->contact->address2a); 3359 SAFE_FREE_STR(item->contact->address2a);
3901 SAFE_FREE(item->contact->address2_desc); 3360 SAFE_FREE_STR(item->contact->address2_desc);
3902 SAFE_FREE(item->contact->address2_transport); 3361 SAFE_FREE_STR(item->contact->address2_transport);
3903 SAFE_FREE(item->contact->address3); 3362 SAFE_FREE_STR(item->contact->address3);
3904 SAFE_FREE(item->contact->address3a); 3363 SAFE_FREE_STR(item->contact->address3a);
3905 SAFE_FREE(item->contact->address3_desc); 3364 SAFE_FREE_STR(item->contact->address3_desc);
3906 SAFE_FREE(item->contact->address3_transport); 3365 SAFE_FREE_STR(item->contact->address3_transport);
3907 SAFE_FREE(item->contact->assistant_name); 3366 SAFE_FREE_STR(item->contact->assistant_name);
3908 SAFE_FREE(item->contact->assistant_phone); 3367 SAFE_FREE_STR(item->contact->assistant_phone);
3909 SAFE_FREE(item->contact->billing_information); 3368 SAFE_FREE_STR(item->contact->billing_information);
3910 SAFE_FREE(item->contact->birthday); 3369 SAFE_FREE(item->contact->birthday);
3911 SAFE_FREE(item->contact->business_address); 3370 SAFE_FREE_STR(item->contact->business_address);
3912 SAFE_FREE(item->contact->business_city); 3371 SAFE_FREE_STR(item->contact->business_city);
3913 SAFE_FREE(item->contact->business_country); 3372 SAFE_FREE_STR(item->contact->business_country);
3914 SAFE_FREE(item->contact->business_fax); 3373 SAFE_FREE_STR(item->contact->business_fax);
3915 SAFE_FREE(item->contact->business_homepage); 3374 SAFE_FREE_STR(item->contact->business_homepage);
3916 SAFE_FREE(item->contact->business_phone); 3375 SAFE_FREE_STR(item->contact->business_phone);
3917 SAFE_FREE(item->contact->business_phone2); 3376 SAFE_FREE_STR(item->contact->business_phone2);
3918 SAFE_FREE(item->contact->business_po_box); 3377 SAFE_FREE_STR(item->contact->business_po_box);
3919 SAFE_FREE(item->contact->business_postal_code); 3378 SAFE_FREE_STR(item->contact->business_postal_code);
3920 SAFE_FREE(item->contact->business_state); 3379 SAFE_FREE_STR(item->contact->business_state);
3921 SAFE_FREE(item->contact->business_street); 3380 SAFE_FREE_STR(item->contact->business_street);
3922 SAFE_FREE(item->contact->callback_phone); 3381 SAFE_FREE_STR(item->contact->callback_phone);
3923 SAFE_FREE(item->contact->car_phone); 3382 SAFE_FREE_STR(item->contact->car_phone);
3924 SAFE_FREE(item->contact->company_main_phone); 3383 SAFE_FREE_STR(item->contact->company_main_phone);
3925 SAFE_FREE(item->contact->company_name); 3384 SAFE_FREE_STR(item->contact->company_name);
3926 SAFE_FREE(item->contact->computer_name); 3385 SAFE_FREE_STR(item->contact->computer_name);
3927 SAFE_FREE(item->contact->customer_id); 3386 SAFE_FREE_STR(item->contact->customer_id);
3928 SAFE_FREE(item->contact->def_postal_address); 3387 SAFE_FREE_STR(item->contact->def_postal_address);
3929 SAFE_FREE(item->contact->department); 3388 SAFE_FREE_STR(item->contact->department);
3930 SAFE_FREE(item->contact->display_name_prefix); 3389 SAFE_FREE_STR(item->contact->display_name_prefix);
3931 SAFE_FREE(item->contact->first_name); 3390 SAFE_FREE_STR(item->contact->first_name);
3932 SAFE_FREE(item->contact->followup); 3391 SAFE_FREE_STR(item->contact->followup);
3933 SAFE_FREE(item->contact->free_busy_address); 3392 SAFE_FREE_STR(item->contact->free_busy_address);
3934 SAFE_FREE(item->contact->ftp_site); 3393 SAFE_FREE_STR(item->contact->ftp_site);
3935 SAFE_FREE(item->contact->fullname); 3394 SAFE_FREE_STR(item->contact->fullname);
3936 SAFE_FREE(item->contact->gov_id); 3395 SAFE_FREE_STR(item->contact->gov_id);
3937 SAFE_FREE(item->contact->hobbies); 3396 SAFE_FREE_STR(item->contact->hobbies);
3938 SAFE_FREE(item->contact->home_address); 3397 SAFE_FREE_STR(item->contact->home_address);
3939 SAFE_FREE(item->contact->home_city); 3398 SAFE_FREE_STR(item->contact->home_city);
3940 SAFE_FREE(item->contact->home_country); 3399 SAFE_FREE_STR(item->contact->home_country);
3941 SAFE_FREE(item->contact->home_fax); 3400 SAFE_FREE_STR(item->contact->home_fax);
3942 SAFE_FREE(item->contact->home_po_box); 3401 SAFE_FREE_STR(item->contact->home_po_box);
3943 SAFE_FREE(item->contact->home_phone); 3402 SAFE_FREE_STR(item->contact->home_phone);
3944 SAFE_FREE(item->contact->home_phone2); 3403 SAFE_FREE_STR(item->contact->home_phone2);
3945 SAFE_FREE(item->contact->home_postal_code); 3404 SAFE_FREE_STR(item->contact->home_postal_code);
3946 SAFE_FREE(item->contact->home_state); 3405 SAFE_FREE_STR(item->contact->home_state);
3947 SAFE_FREE(item->contact->home_street); 3406 SAFE_FREE_STR(item->contact->home_street);
3948 SAFE_FREE(item->contact->initials); 3407 SAFE_FREE_STR(item->contact->initials);
3949 SAFE_FREE(item->contact->isdn_phone); 3408 SAFE_FREE_STR(item->contact->isdn_phone);
3950 SAFE_FREE(item->contact->job_title); 3409 SAFE_FREE_STR(item->contact->job_title);
3951 SAFE_FREE(item->contact->keyword); 3410 SAFE_FREE_STR(item->contact->keyword);
3952 SAFE_FREE(item->contact->language); 3411 SAFE_FREE_STR(item->contact->language);
3953 SAFE_FREE(item->contact->location); 3412 SAFE_FREE_STR(item->contact->location);
3954 SAFE_FREE(item->contact->manager_name); 3413 SAFE_FREE_STR(item->contact->manager_name);
3955 SAFE_FREE(item->contact->middle_name); 3414 SAFE_FREE_STR(item->contact->middle_name);
3956 SAFE_FREE(item->contact->mileage); 3415 SAFE_FREE_STR(item->contact->mileage);
3957 SAFE_FREE(item->contact->mobile_phone); 3416 SAFE_FREE_STR(item->contact->mobile_phone);
3958 SAFE_FREE(item->contact->nickname); 3417 SAFE_FREE_STR(item->contact->nickname);
3959 SAFE_FREE(item->contact->office_loc); 3418 SAFE_FREE_STR(item->contact->office_loc);
3960 SAFE_FREE(item->contact->org_id); 3419 SAFE_FREE_STR(item->contact->common_name);
3961 SAFE_FREE(item->contact->other_address); 3420 SAFE_FREE_STR(item->contact->org_id);
3962 SAFE_FREE(item->contact->other_city); 3421 SAFE_FREE_STR(item->contact->other_address);
3963 SAFE_FREE(item->contact->other_country); 3422 SAFE_FREE_STR(item->contact->other_city);
3964 SAFE_FREE(item->contact->other_phone); 3423 SAFE_FREE_STR(item->contact->other_country);
3965 SAFE_FREE(item->contact->other_po_box); 3424 SAFE_FREE_STR(item->contact->other_phone);
3966 SAFE_FREE(item->contact->other_postal_code); 3425 SAFE_FREE_STR(item->contact->other_po_box);
3967 SAFE_FREE(item->contact->other_state); 3426 SAFE_FREE_STR(item->contact->other_postal_code);
3968 SAFE_FREE(item->contact->other_street); 3427 SAFE_FREE_STR(item->contact->other_state);
3969 SAFE_FREE(item->contact->pager_phone); 3428 SAFE_FREE_STR(item->contact->other_street);
3970 SAFE_FREE(item->contact->personal_homepage); 3429 SAFE_FREE_STR(item->contact->pager_phone);
3971 SAFE_FREE(item->contact->pref_name); 3430 SAFE_FREE_STR(item->contact->personal_homepage);
3972 SAFE_FREE(item->contact->primary_fax); 3431 SAFE_FREE_STR(item->contact->pref_name);
3973 SAFE_FREE(item->contact->primary_phone); 3432 SAFE_FREE_STR(item->contact->primary_fax);
3974 SAFE_FREE(item->contact->profession); 3433 SAFE_FREE_STR(item->contact->primary_phone);
3975 SAFE_FREE(item->contact->radio_phone); 3434 SAFE_FREE_STR(item->contact->profession);
3976 SAFE_FREE(item->contact->spouse_name); 3435 SAFE_FREE_STR(item->contact->radio_phone);
3977 SAFE_FREE(item->contact->suffix); 3436 SAFE_FREE_STR(item->contact->spouse_name);
3978 SAFE_FREE(item->contact->surname); 3437 SAFE_FREE_STR(item->contact->suffix);
3979 SAFE_FREE(item->contact->telex); 3438 SAFE_FREE_STR(item->contact->surname);
3980 SAFE_FREE(item->contact->transmittable_display_name); 3439 SAFE_FREE_STR(item->contact->telex);
3981 SAFE_FREE(item->contact->ttytdd_phone); 3440 SAFE_FREE_STR(item->contact->transmittable_display_name);
3441 SAFE_FREE_STR(item->contact->ttytdd_phone);
3982 SAFE_FREE(item->contact->wedding_anniversary); 3442 SAFE_FREE(item->contact->wedding_anniversary);
3983 SAFE_FREE(item->contact->work_address_street); 3443 SAFE_FREE_STR(item->contact->work_address_street);
3984 SAFE_FREE(item->contact->work_address_city); 3444 SAFE_FREE_STR(item->contact->work_address_city);
3985 SAFE_FREE(item->contact->work_address_state); 3445 SAFE_FREE_STR(item->contact->work_address_state);
3986 SAFE_FREE(item->contact->work_address_postalcode); 3446 SAFE_FREE_STR(item->contact->work_address_postalcode);
3987 SAFE_FREE(item->contact->work_address_country); 3447 SAFE_FREE_STR(item->contact->work_address_country);
3988 SAFE_FREE(item->contact->work_address_postofficebox); 3448 SAFE_FREE_STR(item->contact->work_address_postofficebox);
3989 free(item->contact); 3449 free(item->contact);
3990 } 3450 }
3991 3451
3992 pst_free_attach(item->attach); 3452 pst_free_attach(item->attach);
3993 3453
3999 item->extra_fields = et; 3459 item->extra_fields = et;
4000 } 3460 }
4001 if (item->journal) { 3461 if (item->journal) {
4002 SAFE_FREE(item->journal->end); 3462 SAFE_FREE(item->journal->end);
4003 SAFE_FREE(item->journal->start); 3463 SAFE_FREE(item->journal->start);
4004 SAFE_FREE(item->journal->type); 3464 SAFE_FREE_STR(item->journal->type);
4005 free(item->journal); 3465 free(item->journal);
4006 } 3466 }
4007 if (item->appointment) { 3467 if (item->appointment) {
4008 SAFE_FREE(item->appointment->location); 3468 SAFE_FREE_STR(item->appointment->location);
4009 SAFE_FREE(item->appointment->reminder); 3469 SAFE_FREE(item->appointment->reminder);
4010 SAFE_FREE(item->appointment->alarm_filename); 3470 SAFE_FREE_STR(item->appointment->alarm_filename);
4011 SAFE_FREE(item->appointment->start); 3471 SAFE_FREE(item->appointment->start);
4012 SAFE_FREE(item->appointment->end); 3472 SAFE_FREE(item->appointment->end);
4013 SAFE_FREE(item->appointment->timezonestring); 3473 SAFE_FREE_STR(item->appointment->timezonestring);
4014 SAFE_FREE(item->appointment->recurrence); 3474 SAFE_FREE_STR(item->appointment->recurrence);
4015 SAFE_FREE(item->appointment->recurrence_start); 3475 SAFE_FREE(item->appointment->recurrence_start);
4016 SAFE_FREE(item->appointment->recurrence_end); 3476 SAFE_FREE(item->appointment->recurrence_end);
4017 free(item->appointment); 3477 free(item->appointment);
4018 } 3478 }
4019 SAFE_FREE(item->ascii_type); 3479 SAFE_FREE(item->ascii_type);
4020 SAFE_FREE(item->body_charset); 3480 SAFE_FREE_STR(item->body_charset);
4021 SAFE_FREE(item->comment); 3481 SAFE_FREE_STR(item->body);
3482 SAFE_FREE_STR(item->subject);
3483 SAFE_FREE_STR(item->comment);
4022 SAFE_FREE(item->create_date); 3484 SAFE_FREE(item->create_date);
4023 SAFE_FREE(item->file_as); 3485 SAFE_FREE_STR(item->file_as);
4024 SAFE_FREE(item->modify_date); 3486 SAFE_FREE(item->modify_date);
4025 SAFE_FREE(item->outlook_version); 3487 SAFE_FREE_STR(item->outlook_version);
4026 SAFE_FREE(item->record_key); 3488 SAFE_FREE(item->record_key);
4027 free(item); 3489 free(item);
4028 } 3490 }
4029 DEBUG_RET(); 3491 DEBUG_RET();
4030 } 3492 }
4785 DEBUG_RET(); 4247 DEBUG_RET();
4786 return buffer; 4248 return buffer;
4787 } 4249 }
4788 4250
4789 4251
4252 /** Convert a code page integer into a string suitable for iconv
4253 *
4254 * @param cp the code page integer used in the pst file
4255 * @return pointer to a static buffer holding the string representation of the
4256 * equivalent iconv character set
4257 */
4258 const char* codepage(int cp) {
4259 static char buffer[20];
4260 switch (cp) {
4261 case 932 : return "iso-2022-jp";
4262 case 936 : return "gb2313";
4263 case 950 : return "big5";
4264 case 20127 : return "us-ascii";
4265 case 20269 : return "iso-6937";
4266 case 20865 : return "iso-8859-15";
4267 case 20866 : return "koi8-r";
4268 case 21866 : return "koi8-u";
4269 case 28591 : return "iso-8859-1";
4270 case 28592 : return "iso-8859-2";
4271 case 28595 : return "iso-8859-5";
4272 case 28596 : return "iso-8859-6";
4273 case 28597 : return "iso-8859-7";
4274 case 28598 : return "iso-8859-8";
4275 case 28599 : return "iso-8859-9";
4276 case 50220 : return "iso-2022-jp";
4277 case 50221 : return "csiso2022jp";
4278 case 51932 : return "euc-jp";
4279 case 51949 : return "euc-kr";
4280 case 65000 : return "utf-7";
4281 case 65001 : return "utf-8";
4282 default :
4283 snprintf(buffer, sizeof(buffer), "windows-%d", cp);
4284 return buffer;
4285 }
4286 return NULL;
4287 }
4288
4289
4290 /** get the default character set for this item
4291 * @param item pointer to the mapi item of interest
4292 * @return default character set
4293 */
4294 const char* pst_default_charset(pst_item *item)
4295 {
4296 return (item->body_charset.str) ? item->body_charset.str :
4297 (item->message_codepage) ? codepage(item->message_codepage) :
4298 (item->internet_cpid) ? codepage(item->internet_cpid) :
4299 "utf-8";
4300 }
4301
4302
4303 /** Convert str to utf8 if possible. Null strings are preserved
4304 *
4305 * @param item pointer to the mapi item of interest
4306 * &param str pointer to the mapi string of interest
4307 */
4308 void pst_convert_utf8_null(pst_item *item, pst_string *str)
4309 {
4310 if (!str->str) return;
4311 pst_convert_utf8(item, str);
4312 }
4313
4314
4315 /** Convert str to utf8 if possible. Null strings are converted into empty strings.
4316 *
4317 * @param item pointer to the mapi item of interest
4318 * &param str pointer to the mapi string of interest
4319 */
4320 void pst_convert_utf8(pst_item *item, pst_string *str)
4321 {
4322 if (str->is_utf8) return;
4323 if (!str->str) {
4324 str->str = strdup("");
4325 return;
4326 }
4327 DEBUG_ENT("pst_convert_utf8");
4328 const char *charset = pst_default_charset(item);
4329 if (!strcasecmp("utf-8", charset)) return; // already utf8
4330 vbuf *newer = vballoc(2);
4331 size_t rc = vb_8bit2utf8(newer, str->str, strlen(str->str) + 1, charset);
4332 if (rc == (size_t)-1) {
4333 free(newer->b);
4334 DEBUG_EMAIL(("Failed to convert %s to utf-8 - %s\n", charset, str->str));
4335 }
4336 else {
4337 free(str->str);
4338 str->str = newer->b;
4339 str->is_utf8 = 1;
4340 }
4341 free(newer);
4342 DEBUG_RET();
4343 }