[Commits] [SCM] claws branch, master, updated. 3.14.1-199-gcc3882f
ticho at claws-mail.org
ticho at claws-mail.org
Fri Feb 24 20:50:08 CET 2017
The branch, master has been updated
via cc3882f3602f1b44407248a19ab2c40175b98f91 (commit)
from bbeb55d2ede594a176feceb60c1a5ed6eb627bd4 (commit)
Summary of changes:
configure.ac | 69 +-
src/plugins/tnef_parse/Makefile.am | 17 +-
src/plugins/tnef_parse/mapi.h | 51 --
src/plugins/tnef_parse/mapidefs.h | 455 -----------
src/plugins/tnef_parse/mapitags.h | 454 -----------
src/plugins/tnef_parse/tnef-errors.h | 38 -
src/plugins/tnef_parse/tnef-types.h | 144 ----
src/plugins/tnef_parse/tnef_dump.c | 26 +-
src/plugins/tnef_parse/tnef_parse.c | 18 +-
src/plugins/tnef_parse/ytnef.c | 1434 ----------------------------------
src/plugins/tnef_parse/ytnef.h | 121 ---
11 files changed, 106 insertions(+), 2721 deletions(-)
delete mode 100644 src/plugins/tnef_parse/mapi.h
delete mode 100644 src/plugins/tnef_parse/mapidefs.h
delete mode 100644 src/plugins/tnef_parse/mapitags.h
delete mode 100644 src/plugins/tnef_parse/tnef-errors.h
delete mode 100644 src/plugins/tnef_parse/tnef-types.h
delete mode 100644 src/plugins/tnef_parse/ytnef.c
delete mode 100644 src/plugins/tnef_parse/ytnef.h
- Log -----------------------------------------------------------------
commit cc3882f3602f1b44407248a19ab2c40175b98f91
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Wed Feb 22 10:26:09 2017 +0100
Remove internal libytnef and require an external one instead.
diff --git a/configure.ac b/configure.ac
index 99cb448..e94641e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1102,7 +1102,7 @@ AC_ARG_ENABLE(demo-plugin,
dnl Then we check (unconditionnaly) for plugins dependencies
-dnl Some dependencies are optional, some mandatories. This is taken care of
+dnl Some dependencies are optional, some mandatory. This is taken care of
dnl later.
dnl
dnl During this dependancy check we do the checks themselves, define HAVE_X to
@@ -1124,6 +1124,7 @@ dnl Python: Python
dnl RSSyl: expat libcurl
dnl SpamReport: libcurl
dnl vCalendar: libcurl, libical
+dnl tnef_parse: libytnef
dnl libcurl ********************************************************************
PKG_CHECK_MODULES(CURL, libcurl, HAVE_CURL=yes, HAVE_CURL=no)
@@ -1342,6 +1343,51 @@ fi
AC_SUBST(CM_NP_HOTKEY_CFLAGS)
AC_SUBST(CM_NP_HOTKEY_LIBS)
+dnl libytnef *******************************************************************
+YTNEF_CFLAGS=""
+YTNEF_LIBS=""
+have_ytnef=0
+# Check both ytnef.h and libytnef/ytnef.h, and adjust YTNEF_CFLAGS
+# accordingly
+AC_CHECK_HEADER(ytnef.h, [have_ytnef=1], [have_ytnef=0])
+if test $have_ytnef -eq 0; then
+ AC_CHECK_HEADER(libytnef/ytnef.h,
+ [have_ytnef=1;
+ YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_H_SUBDIR"],
+ [have_ytnef=0])
+fi
+if test $have_ytnef -eq 1; then
+ AC_MSG_CHECKING([how libytnef's SwapDDWord() should be called])
+ # Now we have to figure out which libytnef version we're using,
+ # based on whether SwapDDWord takes one argument or two.
+ if test "x${YTNEF_CFLAGS}" = "x"; then
+ ytnef_include="#include <ytnef.h>"
+ else
+ ytnef_include="#include <libytnef/ytnef.h>"
+ fi
+ AC_TRY_COMPILE([#include <stdio.h>
+ ${ytnef_include}],
+ [SwapDDWord(0, 0);],
+ [have_ytnef=1],
+ [have_ytnef=0])
+ if test $have_ytnef -eq 0; then
+ AC_TRY_COMPILE([#include <stdio.h>
+ ${ytnef_include}],
+ [SwapDDWord(0);],
+ [have_ytnef=1;
+ YTNEF_CFLAGS="${YTNEF_CFLAGS} -DYTNEF_OLD_SWAPDDWORD"],
+ [have_ytnef=0])
+ fi
+ if test $have_ytnef -eq 1; then
+ YTNEF_LIBS="-lytnef"
+ AC_MSG_RESULT(ok)
+ else
+ AC_MSG_RESULT(no idea, unsupported libytnef version?)
+ fi
+fi
+AC_SUBST(YTNEF_CFLAGS)
+AC_SUBST(YTNEF_LIBS)
+
dnl Third, we now cross the requested plugins and the available dependencies
dnl If some dependencies are missing and the plugin was explicitely enabled,
dnl we error out, else we only inform.
@@ -1857,13 +1903,30 @@ fi
AC_MSG_CHECKING([whether to build tnef_parse plugin])
if test x"$enable_tnef_parse_plugin" != xno; then
- PLUGINS="$PLUGINS tnef_parse"
- AC_MSG_RESULT(yes)
+ dependencies_missing=""
+
+ if test $have_ytnef -eq 0; then
+ dependencies_missing="libytnef"
+ fi
+
+ if test x"$dependencies_missing" = x; then
+ PLUGINS="$PLUGINS tnef_parse"
+ AC_MSG_RESULT(yes)
+ elif test x"$enable_tnef_parse_plugin" = xauto; then
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN(Plugin tnef_parse will not be built; missing $dependencies_missing")
+ enable_tnef_parse_plugin=no
+ MISSING_DEPS_PLUGINS="$MISSING_DEPS_PLUGINS tnef_parse"
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN(Plugin tnef_parse will not be built; missing $dependencies_missing")
+ fi
else
DISABLED_PLUGINS="$DISABLED_PLUGINS tnef_parse"
AC_MSG_RESULT(no)
fi
+
AC_MSG_CHECKING([whether to build vcalendar plugin])
if test x"$enable_vcalendar_plugin" != xno; then
dependencies_missing=""
diff --git a/src/plugins/tnef_parse/Makefile.am b/src/plugins/tnef_parse/Makefile.am
index 699fd46..b4b1e50 100644
--- a/src/plugins/tnef_parse/Makefile.am
+++ b/src/plugins/tnef_parse/Makefile.am
@@ -55,13 +55,13 @@ endif
tnef_parse_la_SOURCES = \
tnef_parse.c \
tnef_dump.c \
- tnef_dump.h \
- ytnef.c
+ tnef_dump.h
tnef_parse_la_LDFLAGS = \
$(plugin_res_ldflag) $(no_undefined) $(export_symbols) \
-avoid-version -module \
- $(GTK_LIBS)
+ $(GTK_LIBS) \
+ $(YTNEF_LIBS)
tnef_parse_la_DEPENDENCIES = $(plugin_deps)
@@ -69,13 +69,7 @@ tnef_parse_la_LIBADD = $(plugin_ldadd) $(cygwin_export_lib) \
$(GTK_LIBS)
noinst_HEADERS = \
- mapidefs.h \
- mapi.h \
- mapitags.h \
- tnef_dump.h \
- tnef-errors.h \
- tnef-types.h \
- ytnef.h
+ tnef_dump.h
IFLAGS = \
-I$(top_srcdir)/src \
@@ -86,4 +80,5 @@ IFLAGS = \
tnef_parse_la_CPPFLAGS = \
$(IFLAGS) \
$(GLIB_CFLAGS) \
- $(GTK_CFLAGS)
+ $(GTK_CFLAGS) \
+ $(YTNEF_CFLAGS)
diff --git a/src/plugins/tnef_parse/mapi.h b/src/plugins/tnef_parse/mapi.h
deleted file mode 100644
index 054f8fc..0000000
--- a/src/plugins/tnef_parse/mapi.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-* Copyright (C) 2004-2014 Colin Leroy and the Claws Mail team
-*
-* Yerase's TNEF Stream Reader Library
-* Copyright (C) 2003 Randall E. Hand
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* You can contact me at randall.hand at gmail.com for questions or assistance
-*/
-#define MV_FLAG 0x1000 /* Multi-value flag */
-
-#define PT_UNSPECIFIED ((ULONG) 0) /* (Reserved for interface use) type doesn't matter to caller */
-#define PT_NULL ((ULONG) 1) /* NULL property value */
-#define PT_I2 ((ULONG) 2) /* Signed 16-bit value */
-#define PT_LONG ((ULONG) 3) /* Signed 32-bit value */
-#define PT_R4 ((ULONG) 4) /* 4-byte floating point */
-#define PT_DOUBLE ((ULONG) 5) /* Floating point double */
-#define PT_CURRENCY ((ULONG) 6) /* Signed 64-bit int (decimal w/ 4 digits right of decimal pt) */
-#define PT_APPTIME ((ULONG) 7) /* Application time */
-#define PT_ERROR ((ULONG) 10) /* 32-bit error value */
-#define PT_BOOLEAN ((ULONG) 11) /* 16-bit boolean (non-zero true) */
-#define PT_OBJECT ((ULONG) 13) /* Embedded object in a property */
-#define PT_I8 ((ULONG) 20) /* 8-byte signed integer */
-#define PT_STRING8 ((ULONG) 30) /* Null terminated 8-bit character string */
-#define PT_UNICODE ((ULONG) 31) /* Null terminated Unicode string */
-#define PT_SYSTIME ((ULONG) 64) /* FILETIME 64-bit int w/ number of 100ns periods since Jan 1,1601 */
-#define PT_CLSID ((ULONG) 72) /* OLE GUID */
-#define PT_BINARY ((ULONG) 258) /* Uninterpreted (counted byte array) */
-
-#define PROP_TYPE_MASK ((ULONG)0x0000FFFF) /* Mask for Property type */
-#define PROP_TYPE(ulPropTag) (((ULONG)(ulPropTag))&PROP_TYPE_MASK)
-#define PROP_ID(ulPropTag) (((ULONG)(ulPropTag))>>16)
-#define PROP_TAG(ulPropType,ulPropID) ((((ULONG)(ulPropID))<<16)|((ULONG)(ulPropType)))
-#define PROP_ID_NULL 0
-#define PROP_ID_INVALID 0xFFFF
-#define PR_NULL PROP_TAG( PT_NULL, PROP_ID_NULL)
-
-#define MAPI_UNDEFINED ((variableLength*)-1)
diff --git a/src/plugins/tnef_parse/mapidefs.h b/src/plugins/tnef_parse/mapidefs.h
deleted file mode 100644
index 933b90d..0000000
--- a/src/plugins/tnef_parse/mapidefs.h
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
-* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-* Copyright (C) 2004-2014 Colin Leroy and the Claws Mail team
-*
-* Yerase's TNEF Stream Reader Library
-* Copyright (C) 2003 Randall E. Hand
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* You can contact me at randall.hand at gmail.com for questions or assistance
-*/
-#ifndef MAPIDEFS_H
-#define MAPIDEFS_H
-
-#define PR_ACKNOWLEDGEMENT_MODE 0x0001
-#define PR_ALTERNATE_RECIPIENT_ALLOWED 0x0002
-#define PR_AUTHORIZING_USERS 0x0003
-#define PR_AUTO_FORWARD_COMMENT 0x0004
-#define PR_AUTO_FORWARDED 0x0005
-#define PR_CONTENT_CONFIDENTIALITY_ALGORITHM_ID 0x0006
-#define PR_CONTENT_CORRELATOR 0x0007
-#define PR_CONTENT_IDENTIFIER 0x0008
-#define PR_CONTENT_LENGTH 0x0009
-#define PR_CONTENT_RETURN_REQUESTED 0x000A
-#define PR_CONVERSATION_KEY 0x000B
-#define PR_CONVERSION_EITS 0x000C
-#define PR_CONVERSION_WITH_LOSS_PROHIBITED 0x000D
-#define PR_CONVERTED_EITS 0x000E
-#define PR_DEFERRED_DELIVERY_TIME 0x000F
-#define PR_DELIVER_TIME 0x0010
-#define PR_DISCARD_REASON 0x0011
-#define PR_DISCLOSURE_OF_RECIPIENTS 0x0012
-#define PR_DL_EXPANSION_HISTORY 0x0013
-#define PR_DL_EXPANSION_PROHIBITED 0x0014
-#define PR_EXPIRY_TIME 0x0015
-#define PR_IMPLICIT_CONVERSION_PROHIBITED 0x0016
-#define PR_IMPORTANCE 0x0017
-#define PR_IPM_ID 0x0018
-#define PR_LATEST_DELIVERY_TIME 0x0019
-#define PR_MESSAGE_CLASS 0x001A
-#define PR_MESSAGE_DELIVERY_ID 0x001B
-#define PR_MESSAGE_SECURITY_LABEL 0x001E
-#define PR_OBSOLETED_IPMS 0x001F
-#define PR_ORIGINALLY_INTENDED_RECIPIENT_NAME 0x0020
-#define PR_ORIGINAL_EITS 0x0021
-#define PR_ORIGINATOR_CERTIFICATE 0x0022
-#define PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED 0x0023
-#define PR_ORIGINATOR_RETURN_ADDRESS 0x0024
-#define PR_PARENT_KEY 0x0025
-#define PR_PRIORITY 0x0026
-#define PR_ORIGIN_CHECK 0x0027
-#define PR_PROOF_OF_SUBMISSION_REQUESTED 0x0028
-#define PR_READ_RECEIPT_REQUESTED 0x0029
-#define PR_RECEIPT_TIME 0x002A
-#define PR_RECIPIENT_REASSIGNMENT_PROHIBITED 0x002B
-#define PR_REDIRECTION_HISTORY 0x002C
-#define PR_RELATED_IPMS 0x002D
-#define PR_ORIGINAL_SENSITIVITY 0x002E
-#define PR_LANGUAGES 0x002F
-#define PR_REPLY_TIME 0x0030
-#define PR_REPORT_TAG 0x0031
-#define PR_REPORT_TIME 0x0032
-#define PR_RETURNED_IPM 0x0033
-#define PR_SECURITY 0x0034
-#define PR_INCOMPLETE_COPY 0x0035
-#define PR_SENSITIVITY 0x0036
-#define PR_SUBJECT 0x0037
-#define PR_SUBJECT_IPM 0x0038
-#define PR_CLIENT_SUBMIT_TIME 0x0039
-#define PR_REPORT_NAME 0x003A
-#define PR_SENT_REPRESENTING_SEARCH_KEY 0x003B
-#define PR_X400_CONTENT_TYPE 0x003C
-#define PR_SUBJECT_PREFIX 0x003D
-#define PR_NON_RECEIPT_REASON 0x003E
-#define PR_RECEIVED_BY_ENTRYID 0x003F
-#define PR_RECEIVED_BY_NAME 0x0040
-#define PR_SENT_REPRESENTING_ENTRYID 0x0041
-#define PR_SENT_REPRESENTING_NAME 0x0042
-#define PR_RCVD_REPRESENTING_ENTRYID 0x0043
-#define PR_RCVD_REPRESENTING_NAME 0x0044
-#define PR_REPORT_ENTRYID 0x0045
-#define PR_READ_RECEIPT_ENTRYID 0x0046
-#define PR_MESSAGE_SUBMISSION_ID 0x0047
-#define PR_PROVIDER_SUBMIT_TIME 0x0048
-#define PR_ORIGINAL_SUBJECT 0x0049
-#define PR_DISC_VAL 0x004A
-#define PR_ORIG_MESSAGE_CLASS 0x004B
-#define PR_ORIGINAL_AUTHOR_ENTRYID 0x004C
-#define PR_ORIGINAL_AUTHOR_NAME 0x004D
-#define PR_ORIGINAL_SUBMIT_TIME 0x004E
-#define PR_REPLY_RECIPIENT_ENTRIES 0x004F
-#define PR_REPLY_RECIPIENT_NAMES 0x0050
-#define PR_RECEIVED_BY_SEARCH_KEY 0x0051
-#define PR_RCVD_REPRESENTING_SEARCH_KEY 0x0052
-#define PR_READ_RECEIPT_SEARCH_KEY 0x0053
-#define PR_REPORT_SEARCH_KEY 0x0054
-#define PR_ORIGINAL_DELIVERY_TIME 0x0055
-#define PR_ORIGINAL_AUTHOR_SEARCH_KEY 0x0056
-#define PR_MESSAGE_TO_ME 0x0057
-#define PR_MESSAGE_CC_ME 0x0058
-#define PR_MESSAGE_RECIP_ME 0x0059
-#define PR_ORIGINAL_SENDER_NAME 0x005A
-#define PR_ORIGINAL_SENDER_ENTRYID 0x005B
-#define PR_ORIGINAL_SENDER_SEARCH_KEY 0x005C
-#define PR_ORIGINAL_SENT_REPRESENTING_NAME 0x005D
-#define PR_ORIGINAL_SENT_REPRESENTING_ENTRYID 0x005E
-#define PR_ORIGINAL_SENT_REPRESENTING_SEARCH_KEY 0x005F
-#define PR_START_DATE 0x0060
-#define PR_END_DATE 0x0061
-#define PR_OWNER_APPT_ID 0x0062
-#define PR_RESPONSE_REQUESTED 0x0063
-#define PR_SENT_REPRESENTING_ADDRTYPE 0x0064
-#define PR_SENT_REPRESENTING_EMAIL_ADDRESS 0x0065
-#define PR_ORIGINAL_SENDER_ADDRTYPE 0x0066
-#define PR_ORIGINAL_SENDER_EMAIL_ADDRESS 0x0067
-#define PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE 0x0068
-#define PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS 0x0069
-#define PR_CONVERSATION_TOPIC 0x0070
-#define PR_CONVERSATION_INDEX 0x0071
-#define PR_ORIGINAL_DISPLAY_BCC 0x0072
-#define PR_ORIGINAL_DISPLAY_CC 0x0073
-#define PR_ORIGINAL_DISPLAY_TO 0x0074
-#define PR_RECEIVED_BY_ADDRTYPE 0x0075
-#define PR_RECEIVED_BY_EMAIL_ADDRESS 0x0076
-#define PR_RCVD_REPRESENTING_ADDRTYPE 0x0077
-#define PR_RCVD_REPRESENTING_EMAIL_ADDRESS 0x0078
-#define PR_ORIGINAL_AUTHOR_ADDRTYPE 0x0079
-#define PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS 0x007A
-#define PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE 0x007B
-#define PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS 0x007C
-#define PR_TRANSPORT_MESSAGE_HEADERS 0x007D
-#define PR_DELEGATION 0x007E
-#define PR_TNEF_CORRELATION_KEY 0x007F
-#define PR_BODY 0x1000
-#define PR_REPORT_TEXT 0x1001
-#define PR_ORIGINATOR_AND_DL_EXPANSION_HISTORY 0x1002
-#define PR_REPORTING_DL_NAME 0x1003
-#define PR_REPORTING_MTA_CERTIFICATE 0x1004
-#define PR_RTF_SYNC_BODY_CRC 0x1006
-#define PR_RTF_SYNC_BODY_COUNT 0x1007
-#define PR_RTF_SYNC_BODY_TAG 0x1008
-#define PR_RTF_COMPRESSED 0x1009
-#define PR_RTF_SYNC_PREFIX_COUNT 0x1010
-#define PR_RTF_SYNC_TRAILING_COUNT 0x1011
-#define PR_ORIGINALLY_INTENDED_RECIP_ENTRYID 0x1012
-#define PR_CONTENT_INTEGRITY_CHECK 0x0C00
-#define PR_EXPLICIT_CONVERSION 0x0C01
-#define PR_IPM_RETURN_REQUESTED 0x0C02
-#define PR_MESSAGE_TOKEN 0x0C03
-#define PR_NDR_REASON_CODE 0x0C04
-#define PR_NDR_DIAG_CODE 0x0C05
-#define PR_NON_RECEIPT_NOTIFICATION_REQUESTED 0x0C06
-#define PR_DELIVERY_POINT 0x0C07
-
-#define PR_ORIGINATOR_NON_DELIVERY_REPORT_REQUESTED 0x0C08
-#define PR_ORIGINATOR_REQUESTED_ALTERNATE_RECIPIENT 0x0C09
-#define PR_PHYSICAL_DELIVERY_BUREAU_FAX_DELIVERY 0x0C0A
-#define PR_PHYSICAL_DELIVERY_MODE 0x0C0B
-#define PR_PHYSICAL_DELIVERY_REPORT_REQUEST 0x0C0C
-#define PR_PHYSICAL_FORWARDING_ADDRESS 0x0C0D
-#define PR_PHYSICAL_FORWARDING_ADDRESS_REQUESTED 0x0C0E
-#define PR_PHYSICAL_FORWARDING_PROHIBITED 0x0C0F
-#define PR_PHYSICAL_RENDITION_ATTRIBUTES 0x0C10
-#define PR_PROOF_OF_DELIVERY 0x0C11
-#define PR_PROOF_OF_DELIVERY_REQUESTED 0x0C12
-#define PR_RECIPIENT_CERTIFICATE 0x0C13
-#define PR_RECIPIENT_NUMBER_FOR_ADVICE 0x0C14
-#define PR_RECIPIENT_TYPE 0x0C15
-#define PR_REGISTERED_MAIL_TYPE 0x0C16
-#define PR_REPLY_REQUESTED 0x0C17
-#define PR_REQUESTED_DELIVERY_METHOD 0x0C18
-#define PR_SENDER_ENTRYID 0x0C19
-#define PR_SENDER_NAME 0x0C1A
-#define PR_SUPPLEMENTARY_INFO 0x0C1B
-#define PR_TYPE_OF_MTS_USER 0x0C1C
-#define PR_SENDER_SEARCH_KEY 0x0C1D
-#define PR_SENDER_ADDRTYPE 0x0C1E
-#define PR_SENDER_EMAIL_ADDRESS 0x0C1F
-#define PR_CURRENT_VERSION 0x0E00
-#define PR_DELETE_AFTER_SUBMIT 0x0E01
-#define PR_DISPLAY_BCC 0x0E02
-#define PR_DISPLAY_CC 0x0E03
-#define PR_DISPLAY_TO 0x0E04
-#define PR_PARENT_DISPLAY 0x0E05
-#define PR_MESSAGE_DELIVERY_TIME 0x0E06
-#define PR_MESSAGE_FLAGS 0x0E07
-#define PR_MESSAGE_SIZE 0x0E08
-#define PR_PARENT_ENTRYID 0x0E09
-#define PR_SENTMAIL_ENTRYID 0x0E0A
-#define PR_CORRELATE 0x0E0C
-#define PR_CORRELATE_MTSID 0x0E0D
-#define PR_DISCRETE_VALUES 0x0E0E
-#define PR_RESPONSIBILITY 0x0E0F
-#define PR_SPOOLER_STATUS 0x0E10
-#define PR_TRANSPORT_STATUS 0x0E11
-#define PR_MESSAGE_RECIPIENTS 0x0E12
-#define PR_MESSAGE_ATTACHMENTS 0x0E13
-#define PR_SUBMIT_FLAGS 0x0E14
-#define PR_RECIPIENT_STATUS 0x0E15
-#define PR_TRANSPORT_KEY 0x0E16
-#define PR_MSG_STATUS 0x0E17
-#define PR_MESSAGE_DOWNLOAD_TIME 0x0E18
-#define PR_CREATION_VERSION 0x0E19
-#define PR_MODIFY_VERSION 0x0E1A
-#define PR_HASATTACH 0x0E1B
-#define PR_BODY_CRC 0x0E1C
-#define PR_NORMALIZED_SUBJECT 0x0E1D
-#define PR_RTF_IN_SYNC 0x0E1F
-#define PR_ATTACH_SIZE 0x0E20
-#define PR_ATTACH_NUM 0x0E21
-#define PR_PREPROCESS 0x0E22
-#define PR_ORIGINATING_MTA_CERTIFICATE 0x0E25
-#define PR_PROOF_OF_SUBMISSION 0x0E26
-#define PR_ENTRYID 0x0FFF
-#define PR_OBJECT_TYPE 0x0FFE
-#define PR_ICON 0x0FFD
-#define PR_MINI_ICON 0x0FFC
-#define PR_STORE_ENTRYID 0x0FFB
-#define PR_STORE_RECORD_KEY 0x0FFA
-#define PR_RECORD_KEY 0x0FF9
-#define PR_MAPPING_SIGNATURE 0x0FF8
-#define PR_ACCESS_LEVEL 0x0FF7
-#define PR_INSTANCE_KEY 0x0FF6
-#define PR_ROW_TYPE 0x0FF5
-#define PR_ACCESS 0x0FF4
-#define PR_ROWID 0x3000
-#define PR_DISPLAY_NAME 0x3001
-#define PR_ADDRTYPE 0x3002
-#define PR_EMAIL_ADDRESS 0x3003
-#define PR_COMMENT 0x3004
-#define PR_DEPTH 0x3005
-#define PR_PROVIDER_DISPLAY 0x3006
-#define PR_CREATION_TIME 0x3007
-#define PR_LAST_MODIFICATION_TIME 0x3008
-#define PR_RESOURCE_FLAGS 0x3009
-#define PR_PROVIDER_DLL_NAME 0x300A
-#define PR_SEARCH_KEY 0x300B
-#define PR_PROVIDER_UID 0x300C
-#define PR_PROVIDER_ORDINAL 0x300D
-#define PR_FORM_VERSION 0x3301
-#define PR_FORM_CLSID 0x3302
-#define PR_FORM_CONTACT_NAME 0x3303
-#define PR_FORM_CATEGORY 0x3304
-#define PR_FORM_CATEGORY_SUB 0x3305
-#define PR_FORM_HOST_MAP 0x3306
-#define PR_FORM_HIDDEN 0x3307
-#define PR_FORM_DESIGNER_NAME 0x3308
-#define PR_FORM_DESIGNER_GUID 0x3309
-#define PR_FORM_MESSAGE_BEHAVIOR 0x330A
-#define PR_DEFAULT_STORE 0x3400
-#define PR_STORE_SUPPORT_MASK 0x340D
-#define PR_STORE_STATE 0x340E
-#define PR_IPM_SUBTREE_SEARCH_KEY 0x3410
-#define PR_IPM_OUTBOX_SEARCH_KEY 0x3411
-#define PR_IPM_WASTEBASKET_SEARCH_KEY 0x3412
-#define PR_IPM_SENTMAIL_SEARCH_KEY 0x3413
-#define PR_MDB_PROVIDER 0x3414
-#define PR_RECEIVE_FOLDER_SETTINGS 0x3415
-#define PR_VALID_FOLDER_MASK 0x35DF
-#define PR_IPM_SUBTREE_ENTRYID 0x35E0
-#define PR_IPM_OUTBOX_ENTRYID 0x35E2
-#define PR_IPM_WASTEBASKET_ENTRYID 0x35E3
-#define PR_IPM_SENTMAIL_ENTRYID 0x35E4
-#define PR_VIEWS_ENTRYID 0x35E5
-#define PR_COMMON_VIEWS_ENTRYID 0x35E6
-#define PR_FINDER_ENTRYID 0x35E7
-#define PR_CONTAINER_FLAGS 0x3600
-#define PR_FOLDER_TYPE 0x3601
-#define PR_CONTENT_COUNT 0x3602
-#define PR_CONTENT_UNREAD 0x3603
-#define PR_CREATE_TEMPLATES 0x3604
-#define PR_DETAILS_TABLE 0x3605
-#define PR_SEARCH 0x3607
-#define PR_SELECTABLE 0x3609
-#define PR_SUBFOLDERS 0x360A
-#define PR_STATUS 0x360B
-#define PR_ANR 0x360C
-#define PR_CONTENTS_SORT_ORDER 0x360D
-#define PR_CONTAINER_HIERARCHY 0x360E
-#define PR_CONTAINER_CONTENTS 0x360F
-#define PR_FOLDER_ASSOCIATED_CONTENTS 0x3610
-#define PR_DEF_CREATE_DL 0x3611
-#define PR_DEF_CREATE_MAILUSER 0x3612
-#define PR_CONTAINER_CLASS 0x3613
-#define PR_CONTAINER_MODIFY_VERSION 0x3614
-#define PR_AB_PROVIDER_ID 0x3615
-#define PR_DEFAULT_VIEW_ENTRYID 0x3616
-#define PR_ASSOC_CONTENT_COUNT 0x3617
-#define PR_ATTACHMENT_X400_PARAMETERS 0x3700
-#define PR_ATTACH_DATA_OBJ 0x3701
-#define PR_ATTACH_ENCODING 0x3702
-#define PR_ATTACH_EXTENSION 0x3703
-#define PR_ATTACH_FILENAME 0x3704
-#define PR_ATTACH_METHOD 0x3705
-#define PR_ATTACH_LONG_FILENAME 0x3707
-#define PR_ATTACH_PATHNAME 0x3708
-#define PR_ATTACH_RENDERING 0x3709
-#define PR_ATTACH_TAG 0x370A
-#define PR_RENDERING_POSITION 0x370B
-#define PR_ATTACH_TRANSPORT_NAME 0x370C
-#define PR_ATTACH_LONG_PATHNAME 0x370D
-#define PR_ATTACH_MIME_TAG 0x370E
-#define PR_ATTACH_ADDITIONAL_INFO 0x370F
-#define PR_DISPLAY_TYPE 0x3900
-#define PR_TEMPLATEID 0x3902
-#define PR_PRIMARY_CAPABILITY 0x3904
-#define PR_7BIT_DISPLAY_NAME 0x39FF
-#define PR_ACCOUNT 0x3A00
-#define PR_ALTERNATE_RECIPIENT 0x3A01
-#define PR_CALLBACK_TELEPHONE_NUMBER 0x3A02
-#define PR_CONVERSION_PROHIBITED 0x3A03
-#define PR_DISCLOSE_RECIPIENTS 0x3A04
-#define PR_GENERATION 0x3A05
-#define PR_GIVEN_NAME 0x3A06
-#define PR_GOVERNMENT_ID_NUMBER 0x3A07
-#define PR_BUSINESS_TELEPHONE_NUMBER 0x3A08
-#define PR_HOME_TELEPHONE_NUMBER 0x3A09
-#define PR_INITIALS 0x3A0A
-#define PR_KEYWORD 0x3A0B
-#define PR_LANGUAGE 0x3A0C
-#define PR_LOCATION 0x3A0D
-#define PR_MAIL_PERMISSION 0x3A0E
-#define PR_MHS_COMMON_NAME 0x3A0F
-#define PR_ORGANIZATIONAL_ID_NUMBER 0x3A10
-#define PR_SURNAME 0x3A11
-#define PR_ORIGINAL_ENTRYID 0x3A12
-#define PR_ORIGINAL_DISPLAY_NAME 0x3A13
-#define PR_ORIGINAL_SEARCH_KEY 0x3A14
-#define PR_POSTAL_ADDRESS 0x3A15
-#define PR_COMPANY_NAME 0x3A16
-#define PR_TITLE 0x3A17
-#define PR_DEPARTMENT_NAME 0x3A18
-#define PR_OFFICE_LOCATION 0x3A19
-#define PR_PRIMARY_TELEPHONE_NUMBER 0x3A1A
-#define PR_BUSINESS2_TELEPHONE_NUMBER 0x3A1B
-#define PR_MOBILE_TELEPHONE_NUMBER 0x3A1C
-#define PR_RADIO_TELEPHONE_NUMBER 0x3A1D
-#define PR_CAR_TELEPHONE_NUMBER 0x3A1E
-#define PR_OTHER_TELEPHONE_NUMBER 0x3A1F
-#define PR_TRANSMITABLE_DISPLAY_NAME 0x3A20
-#define PR_PAGER_TELEPHONE_NUMBER 0x3A21
-#define PR_USER_CERTIFICATE 0x3A22
-#define PR_PRIMARY_FAX_NUMBER 0x3A23
-#define PR_BUSINESS_FAX_NUMBER 0x3A24
-#define PR_HOME_FAX_NUMBER 0x3A25
-#define PR_COUNTRY 0x3A26
-#define PR_LOCALITY 0x3A27
-#define PR_STATE_OR_PROVINCE 0x3A28
-#define PR_STREET_ADDRESS 0x3A29
-#define PR_POSTAL_CODE 0x3A2A
-#define PR_POST_OFFICE_BOX 0x3A2B
-#define PR_TELEX_NUMBER 0x3A2C
-#define PR_ISDN_NUMBER 0x3A2D
-#define PR_ASSISTANT_TELEPHONE_NUMBER 0x3A2E
-#define PR_HOME2_TELEPHONE_NUMBER 0x3A2F
-#define PR_ASSISTANT 0x3A30
-#define PR_SEND_RICH_INFO 0x3A40
-#define PR_WEDDING_ANNIVERSARY 0x3A41
-#define PR_BIRTHDAY 0x3A42
-#define PR_HOBBIES 0x3A43
-#define PR_MIDDLE_NAME 0x3A44
-#define PR_DISPLAY_NAME_PREFIX 0x3A45
-#define PR_PROFESSION 0x3A46
-#define PR_PREFERRED_BY_NAME 0x3A47
-#define PR_SPOUSE_NAME 0x3A48
-#define PR_COMPUTER_NETWORK_NAME 0x3A49
-#define PR_CUSTOMER_ID 0x3A4A
-#define PR_TTYTDD_PHONE_NUMBER 0x3A4B
-#define PR_FTP_SITE 0x3A4C
-#define PR_GENDER 0x3A4D
-#define PR_MANAGER_NAME 0x3A4E
-#define PR_NICKNAME 0x3A4F
-#define PR_PERSONAL_HOME_PAGE 0x3A50
-#define PR_BUSINESS_HOME_PAGE 0x3A51
-#define PR_CONTACT_VERSION 0x3A52
-#define PR_CONTACT_ENTRYIDS 0x3A53
-#define PR_CONTACT_ADDRTYPES 0x3A54
-#define PR_CONTACT_DEFAULT_ADDRESS_INDEX 0x3A55
-#define PR_CONTACT_EMAIL_ADDRESSES 0x3A56
-#define PR_COMPANY_MAIN_PHONE_NUMBER 0x3A57
-#define PR_CHILDRENS_NAMES 0x3A58
-#define PR_HOME_ADDRESS_CITY 0x3A59
-#define PR_HOME_ADDRESS_COUNTRY 0x3A5A
-#define PR_HOME_ADDRESS_POSTAL_CODE 0x3A5B
-#define PR_HOME_ADDRESS_STATE_OR_PROVINCE 0x3A5C
-#define PR_HOME_ADDRESS_STREET 0x3A5D
-#define PR_HOME_ADDRESS_POST_OFFICE_BOX 0x3A5E
-#define PR_OTHER_ADDRESS_CITY 0x3A5F
-#define PR_OTHER_ADDRESS_COUNTRY 0x3A60
-#define PR_OTHER_ADDRESS_POSTAL_CODE 0x3A61
-#define PR_OTHER_ADDRESS_STATE_OR_PROVINCE 0x3A62
-#define PR_OTHER_ADDRESS_STREET 0x3A63
-#define PR_OTHER_ADDRESS_POST_OFFICE_BOX 0x3A64
-#define PR_STORE_PROVIDERS 0x3D00
-#define PR_AB_PROVIDERS 0x3D01
-#define PR_TRANSPORT_PROVIDERS 0x3D02
-#define PR_DEFAULT_PROFILE 0x3D04
-#define PR_AB_SEARCH_PATH 0x3D05
-#define PR_AB_DEFAULT_DIR 0x3D06
-#define PR_AB_DEFAULT_PAB 0x3D07
-#define PR_FILTERING_HOOKS 0x3D08
-#define PR_SERVICE_NAME 0x3D09
-#define PR_SERVICE_DLL_NAME 0x3D0A
-#define PR_SERVICE_ENTRY_NAME 0x3D0B
-#define PR_SERVICE_UID 0x3D0C
-#define PR_SERVICE_EXTRA_UIDS 0x3D0D
-#define PR_SERVICES 0x3D0E
-#define PR_SERVICE_SUPPORT_FILES 0x3D0F
-#define PR_SERVICE_DELETE_FILES 0x3D10
-#define PR_AB_SEARCH_PATH_UPDATE 0x3D11
-#define PR_PROFILE_NAME 0x3D12
-#define PR_IDENTITY_DISPLAY 0x3E00
-#define PR_IDENTITY_ENTRYID 0x3E01
-#define PR_RESOURCE_METHODS 0x3E02
-#define PR_RESOURCE_TYPE 0x3E03
-#define PR_STATUS_CODE 0x3E04
-#define PR_IDENTITY_SEARCH_KEY 0x3E05
-#define PR_OWN_STORE_ENTRYID 0x3E06
-#define PR_RESOURCE_PATH 0x3E07
-#define PR_STATUS_STRING 0x3E08
-#define PR_X400_DEFERRED_DELIVERY_CANCEL 0x3E09
-#define PR_HEADER_FOLDER_ENTRYID 0x3E0A
-#define PR_REMOTE_PROGRESS 0x3E0B
-#define PR_REMOTE_PROGRESS_TEXT 0x3E0C
-#define PR_REMOTE_VALIDATE_OK 0x3E0D
-#define PR_CONTROL_FLAGS 0x3F00
-#define PR_CONTROL_STRUCTURE 0x3F01
-#define PR_CONTROL_TYPE 0x3F02
-#define PR_DELTAX 0x3F03
-#define PR_DELTAY 0x3F04
-#define PR_XPOS 0x3F05
-#define PR_YPOS 0x3F06
-#define PR_CONTROL_ID 0x3F07
-#define PR_INITIAL_DETAILS_PANE 0x3F08
-
-/*
- * Secure property id range
- */
-
-#define PROP_ID_SECURE_MIN 0x67F0
-#define PROP_ID_SECURE_MAX 0x67FF
-
-
-#endif /* MAPIDEFS_H */
diff --git a/src/plugins/tnef_parse/mapitags.h b/src/plugins/tnef_parse/mapitags.h
deleted file mode 100644
index cfe2c95..0000000
--- a/src/plugins/tnef_parse/mapitags.h
+++ /dev/null
@@ -1,454 +0,0 @@
-/*
-* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-* Copyright (C) 2004-2014 Colin Leroy and the Claws Mail team
-*
-* Yerase's TNEF Stream Reader Library
-* Copyright (C) 2003 Randall E. Hand
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* You can contact me at randall.hand at gmail.com for questions or assistance
-*/
-#ifndef MAPITAGS_H
-#define MAPITAGS_H
-
-#define MAPIMACRO(x) {x, #x}
-typedef struct {
- unsigned int id;
- char name[128];
-} MAPIPropertyTagList;
-
-
-MAPIPropertyTagList MPList[] = {
- MAPIMACRO(PR_ACKNOWLEDGEMENT_MODE ),
- MAPIMACRO(PR_ALTERNATE_RECIPIENT_ALLOWED ),
- MAPIMACRO(PR_AUTHORIZING_USERS ),
- MAPIMACRO(PR_AUTO_FORWARD_COMMENT ),
- MAPIMACRO(PR_AUTO_FORWARDED ),
- MAPIMACRO(PR_CONTENT_CONFIDENTIALITY_ALGORITHM_ID ),
- MAPIMACRO(PR_CONTENT_CORRELATOR ),
- MAPIMACRO(PR_CONTENT_IDENTIFIER ),
- MAPIMACRO(PR_CONTENT_LENGTH ),
- MAPIMACRO(PR_CONTENT_RETURN_REQUESTED ),
- MAPIMACRO(PR_CONVERSATION_KEY ),
- MAPIMACRO(PR_CONVERSION_EITS ),
- MAPIMACRO(PR_CONVERSION_WITH_LOSS_PROHIBITED ),
- MAPIMACRO(PR_CONVERTED_EITS ),
- MAPIMACRO(PR_DEFERRED_DELIVERY_TIME ),
- MAPIMACRO(PR_DELIVER_TIME ),
- MAPIMACRO(PR_DISCARD_REASON ),
- MAPIMACRO(PR_DISCLOSURE_OF_RECIPIENTS ),
- MAPIMACRO(PR_DL_EXPANSION_HISTORY ),
- MAPIMACRO(PR_DL_EXPANSION_PROHIBITED ),
- MAPIMACRO(PR_EXPIRY_TIME ),
- MAPIMACRO(PR_IMPLICIT_CONVERSION_PROHIBITED ),
- MAPIMACRO(PR_IMPORTANCE ),
- MAPIMACRO(PR_IPM_ID ),
- MAPIMACRO(PR_LATEST_DELIVERY_TIME ),
- MAPIMACRO(PR_MESSAGE_CLASS ),
- MAPIMACRO(PR_MESSAGE_DELIVERY_ID ),
- MAPIMACRO(PR_MESSAGE_SECURITY_LABEL ),
- MAPIMACRO(PR_OBSOLETED_IPMS ),
- MAPIMACRO(PR_ORIGINALLY_INTENDED_RECIPIENT_NAME ),
- MAPIMACRO(PR_ORIGINAL_EITS ),
- MAPIMACRO(PR_ORIGINATOR_CERTIFICATE ),
- MAPIMACRO(PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED ),
- MAPIMACRO(PR_ORIGINATOR_RETURN_ADDRESS ),
- MAPIMACRO(PR_PARENT_KEY ),
- MAPIMACRO(PR_PRIORITY ),
- MAPIMACRO(PR_ORIGIN_CHECK ),
- MAPIMACRO(PR_PROOF_OF_SUBMISSION_REQUESTED ),
- MAPIMACRO(PR_READ_RECEIPT_REQUESTED ),
- MAPIMACRO(PR_RECEIPT_TIME ),
- MAPIMACRO(PR_RECIPIENT_REASSIGNMENT_PROHIBITED ),
- MAPIMACRO(PR_REDIRECTION_HISTORY ),
- MAPIMACRO(PR_RELATED_IPMS ),
- MAPIMACRO(PR_ORIGINAL_SENSITIVITY ),
- MAPIMACRO(PR_LANGUAGES ),
- MAPIMACRO(PR_REPLY_TIME ),
- MAPIMACRO(PR_REPORT_TAG ),
- MAPIMACRO(PR_REPORT_TIME ),
- MAPIMACRO(PR_RETURNED_IPM ),
- MAPIMACRO(PR_SECURITY ),
- MAPIMACRO(PR_INCOMPLETE_COPY ),
- MAPIMACRO(PR_SENSITIVITY ),
- MAPIMACRO(PR_SUBJECT ),
- MAPIMACRO(PR_SUBJECT_IPM ),
- MAPIMACRO(PR_CLIENT_SUBMIT_TIME ),
- MAPIMACRO(PR_REPORT_NAME ),
- MAPIMACRO(PR_SENT_REPRESENTING_SEARCH_KEY ),
- MAPIMACRO(PR_X400_CONTENT_TYPE ),
- MAPIMACRO(PR_SUBJECT_PREFIX ),
- MAPIMACRO(PR_NON_RECEIPT_REASON ),
- MAPIMACRO(PR_RECEIVED_BY_ENTRYID ),
- MAPIMACRO(PR_RECEIVED_BY_NAME ),
- MAPIMACRO(PR_SENT_REPRESENTING_ENTRYID ),
- MAPIMACRO(PR_SENT_REPRESENTING_NAME ),
- MAPIMACRO(PR_RCVD_REPRESENTING_ENTRYID ),
- MAPIMACRO(PR_RCVD_REPRESENTING_NAME ),
- MAPIMACRO(PR_REPORT_ENTRYID ),
- MAPIMACRO(PR_READ_RECEIPT_ENTRYID ),
- MAPIMACRO(PR_MESSAGE_SUBMISSION_ID ),
- MAPIMACRO(PR_PROVIDER_SUBMIT_TIME ),
- MAPIMACRO(PR_ORIGINAL_SUBJECT ),
- MAPIMACRO(PR_DISC_VAL ),
- MAPIMACRO(PR_ORIG_MESSAGE_CLASS ),
- MAPIMACRO(PR_ORIGINAL_AUTHOR_ENTRYID ),
- MAPIMACRO(PR_ORIGINAL_AUTHOR_NAME ),
- MAPIMACRO(PR_ORIGINAL_SUBMIT_TIME ),
- MAPIMACRO(PR_REPLY_RECIPIENT_ENTRIES ),
- MAPIMACRO(PR_REPLY_RECIPIENT_NAMES ),
- MAPIMACRO(PR_RECEIVED_BY_SEARCH_KEY ),
- MAPIMACRO(PR_RCVD_REPRESENTING_SEARCH_KEY ),
- MAPIMACRO(PR_READ_RECEIPT_SEARCH_KEY ),
- MAPIMACRO(PR_REPORT_SEARCH_KEY ),
- MAPIMACRO(PR_ORIGINAL_DELIVERY_TIME ),
- MAPIMACRO(PR_ORIGINAL_AUTHOR_SEARCH_KEY ),
- MAPIMACRO(PR_MESSAGE_TO_ME ),
- MAPIMACRO(PR_MESSAGE_CC_ME ),
- MAPIMACRO(PR_MESSAGE_RECIP_ME ),
- MAPIMACRO(PR_ORIGINAL_SENDER_NAME ),
- MAPIMACRO(PR_ORIGINAL_SENDER_ENTRYID ),
- MAPIMACRO(PR_ORIGINAL_SENDER_SEARCH_KEY ),
- MAPIMACRO(PR_ORIGINAL_SENT_REPRESENTING_NAME ),
- MAPIMACRO(PR_ORIGINAL_SENT_REPRESENTING_ENTRYID ),
- MAPIMACRO(PR_ORIGINAL_SENT_REPRESENTING_SEARCH_KEY ),
- MAPIMACRO(PR_START_DATE ),
- MAPIMACRO(PR_END_DATE ),
- MAPIMACRO(PR_OWNER_APPT_ID ),
- MAPIMACRO(PR_RESPONSE_REQUESTED ),
- MAPIMACRO(PR_SENT_REPRESENTING_ADDRTYPE ),
- MAPIMACRO(PR_SENT_REPRESENTING_EMAIL_ADDRESS ),
- MAPIMACRO(PR_ORIGINAL_SENDER_ADDRTYPE ),
- MAPIMACRO(PR_ORIGINAL_SENDER_EMAIL_ADDRESS ),
- MAPIMACRO(PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE ),
- MAPIMACRO(PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS ),
- MAPIMACRO(PR_CONVERSATION_TOPIC ),
- MAPIMACRO(PR_CONVERSATION_INDEX ),
- MAPIMACRO(PR_ORIGINAL_DISPLAY_BCC ),
- MAPIMACRO(PR_ORIGINAL_DISPLAY_CC ),
- MAPIMACRO(PR_ORIGINAL_DISPLAY_TO ),
- MAPIMACRO(PR_RECEIVED_BY_ADDRTYPE ),
- MAPIMACRO(PR_RECEIVED_BY_EMAIL_ADDRESS ),
- MAPIMACRO(PR_RCVD_REPRESENTING_ADDRTYPE ),
- MAPIMACRO(PR_RCVD_REPRESENTING_EMAIL_ADDRESS ),
- MAPIMACRO(PR_ORIGINAL_AUTHOR_ADDRTYPE ),
- MAPIMACRO(PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS ),
- MAPIMACRO(PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE ),
- MAPIMACRO(PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS ),
- MAPIMACRO(PR_TRANSPORT_MESSAGE_HEADERS ),
- MAPIMACRO(PR_DELEGATION ),
- MAPIMACRO(PR_TNEF_CORRELATION_KEY ),
- MAPIMACRO(PR_BODY ),
- MAPIMACRO(PR_REPORT_TEXT ),
- MAPIMACRO(PR_ORIGINATOR_AND_DL_EXPANSION_HISTORY ),
- MAPIMACRO(PR_REPORTING_DL_NAME ),
- MAPIMACRO(PR_REPORTING_MTA_CERTIFICATE ),
- MAPIMACRO(PR_RTF_SYNC_BODY_CRC ),
- MAPIMACRO(PR_RTF_SYNC_BODY_COUNT ),
- MAPIMACRO(PR_RTF_SYNC_BODY_TAG ),
- MAPIMACRO(PR_RTF_COMPRESSED ),
- MAPIMACRO(PR_RTF_SYNC_PREFIX_COUNT ),
- MAPIMACRO(PR_RTF_SYNC_TRAILING_COUNT ),
- MAPIMACRO(PR_ORIGINALLY_INTENDED_RECIP_ENTRYID ),
- MAPIMACRO(PR_CONTENT_INTEGRITY_CHECK ),
- MAPIMACRO(PR_EXPLICIT_CONVERSION ),
- MAPIMACRO(PR_IPM_RETURN_REQUESTED ),
- MAPIMACRO(PR_MESSAGE_TOKEN ),
- MAPIMACRO(PR_NDR_REASON_CODE ),
- MAPIMACRO(PR_NDR_DIAG_CODE ),
- MAPIMACRO(PR_NON_RECEIPT_NOTIFICATION_REQUESTED ),
- MAPIMACRO(PR_DELIVERY_POINT ),
- MAPIMACRO(PR_ORIGINATOR_NON_DELIVERY_REPORT_REQUESTED ),
- MAPIMACRO(PR_ORIGINATOR_REQUESTED_ALTERNATE_RECIPIENT ),
- MAPIMACRO(PR_PHYSICAL_DELIVERY_BUREAU_FAX_DELIVERY ),
- MAPIMACRO(PR_PHYSICAL_DELIVERY_MODE ),
- MAPIMACRO(PR_PHYSICAL_DELIVERY_REPORT_REQUEST ),
- MAPIMACRO(PR_PHYSICAL_FORWARDING_ADDRESS ),
- MAPIMACRO(PR_PHYSICAL_FORWARDING_ADDRESS_REQUESTED ),
- MAPIMACRO(PR_PHYSICAL_FORWARDING_PROHIBITED ),
- MAPIMACRO(PR_PHYSICAL_RENDITION_ATTRIBUTES ),
- MAPIMACRO(PR_PROOF_OF_DELIVERY ),
- MAPIMACRO(PR_PROOF_OF_DELIVERY_REQUESTED ),
- MAPIMACRO(PR_RECIPIENT_CERTIFICATE ),
- MAPIMACRO(PR_RECIPIENT_NUMBER_FOR_ADVICE ),
- MAPIMACRO(PR_RECIPIENT_TYPE ),
- MAPIMACRO(PR_REGISTERED_MAIL_TYPE ),
- MAPIMACRO(PR_REPLY_REQUESTED ),
- MAPIMACRO(PR_REQUESTED_DELIVERY_METHOD ),
- MAPIMACRO(PR_SENDER_ENTRYID ),
- MAPIMACRO(PR_SENDER_NAME ),
- MAPIMACRO(PR_SUPPLEMENTARY_INFO ),
- MAPIMACRO(PR_TYPE_OF_MTS_USER ),
- MAPIMACRO(PR_SENDER_SEARCH_KEY ),
- MAPIMACRO(PR_SENDER_ADDRTYPE ),
- MAPIMACRO(PR_SENDER_EMAIL_ADDRESS ),
- MAPIMACRO(PR_CURRENT_VERSION ),
- MAPIMACRO(PR_DELETE_AFTER_SUBMIT ),
- MAPIMACRO(PR_DISPLAY_BCC ),
- MAPIMACRO(PR_DISPLAY_CC ),
- MAPIMACRO(PR_DISPLAY_TO ),
- MAPIMACRO(PR_PARENT_DISPLAY ),
- MAPIMACRO(PR_MESSAGE_DELIVERY_TIME ),
- MAPIMACRO(PR_MESSAGE_FLAGS ),
- MAPIMACRO(PR_MESSAGE_SIZE ),
- MAPIMACRO(PR_PARENT_ENTRYID ),
- MAPIMACRO(PR_SENTMAIL_ENTRYID ),
- MAPIMACRO(PR_CORRELATE ),
- MAPIMACRO(PR_CORRELATE_MTSID ),
- MAPIMACRO(PR_DISCRETE_VALUES ),
- MAPIMACRO(PR_RESPONSIBILITY ),
- MAPIMACRO(PR_SPOOLER_STATUS ),
- MAPIMACRO(PR_TRANSPORT_STATUS ),
- MAPIMACRO(PR_MESSAGE_RECIPIENTS ),
- MAPIMACRO(PR_MESSAGE_ATTACHMENTS ),
- MAPIMACRO(PR_SUBMIT_FLAGS ),
- MAPIMACRO(PR_RECIPIENT_STATUS ),
- MAPIMACRO(PR_TRANSPORT_KEY ),
- MAPIMACRO(PR_MSG_STATUS ),
- MAPIMACRO(PR_MESSAGE_DOWNLOAD_TIME ),
- MAPIMACRO(PR_CREATION_VERSION ),
- MAPIMACRO(PR_MODIFY_VERSION ),
- MAPIMACRO(PR_HASATTACH ),
- MAPIMACRO(PR_BODY_CRC ),
- MAPIMACRO(PR_NORMALIZED_SUBJECT ),
- MAPIMACRO(PR_RTF_IN_SYNC ),
- MAPIMACRO(PR_ATTACH_SIZE ),
- MAPIMACRO(PR_ATTACH_NUM ),
- MAPIMACRO(PR_PREPROCESS ),
- MAPIMACRO(PR_ORIGINATING_MTA_CERTIFICATE ),
- MAPIMACRO(PR_PROOF_OF_SUBMISSION ),
- MAPIMACRO(PR_ENTRYID ),
- MAPIMACRO(PR_OBJECT_TYPE ),
- MAPIMACRO(PR_ICON ),
- MAPIMACRO(PR_MINI_ICON ),
- MAPIMACRO(PR_STORE_ENTRYID ),
- MAPIMACRO(PR_STORE_RECORD_KEY ),
- MAPIMACRO(PR_RECORD_KEY ),
- MAPIMACRO(PR_MAPPING_SIGNATURE ),
- MAPIMACRO(PR_ACCESS_LEVEL ),
- MAPIMACRO(PR_INSTANCE_KEY ),
- MAPIMACRO(PR_ROW_TYPE ),
- MAPIMACRO(PR_ACCESS ),
- MAPIMACRO(PR_ROWID ),
- MAPIMACRO(PR_DISPLAY_NAME ),
- MAPIMACRO(PR_ADDRTYPE ),
- MAPIMACRO(PR_EMAIL_ADDRESS ),
- MAPIMACRO(PR_COMMENT ),
- MAPIMACRO(PR_DEPTH ),
- MAPIMACRO(PR_PROVIDER_DISPLAY ),
- MAPIMACRO(PR_CREATION_TIME ),
- MAPIMACRO(PR_LAST_MODIFICATION_TIME ),
- MAPIMACRO(PR_RESOURCE_FLAGS ),
- MAPIMACRO(PR_PROVIDER_DLL_NAME ),
- MAPIMACRO(PR_SEARCH_KEY ),
- MAPIMACRO(PR_PROVIDER_UID ),
- MAPIMACRO(PR_PROVIDER_ORDINAL ),
- MAPIMACRO(PR_FORM_VERSION ),
- MAPIMACRO(PR_FORM_CLSID ),
- MAPIMACRO(PR_FORM_CONTACT_NAME ),
- MAPIMACRO(PR_FORM_CATEGORY ),
- MAPIMACRO(PR_FORM_CATEGORY_SUB ),
- MAPIMACRO(PR_FORM_HOST_MAP ),
- MAPIMACRO(PR_FORM_HIDDEN ),
- MAPIMACRO(PR_FORM_DESIGNER_NAME ),
- MAPIMACRO(PR_FORM_DESIGNER_GUID ),
- MAPIMACRO(PR_FORM_MESSAGE_BEHAVIOR ),
- MAPIMACRO(PR_DEFAULT_STORE ),
- MAPIMACRO(PR_STORE_SUPPORT_MASK ),
- MAPIMACRO(PR_STORE_STATE ),
- MAPIMACRO(PR_IPM_SUBTREE_SEARCH_KEY ),
- MAPIMACRO(PR_IPM_OUTBOX_SEARCH_KEY ),
- MAPIMACRO(PR_IPM_WASTEBASKET_SEARCH_KEY ),
- MAPIMACRO(PR_IPM_SENTMAIL_SEARCH_KEY ),
- MAPIMACRO(PR_MDB_PROVIDER ),
- MAPIMACRO(PR_RECEIVE_FOLDER_SETTINGS ),
- MAPIMACRO(PR_VALID_FOLDER_MASK ),
- MAPIMACRO(PR_IPM_SUBTREE_ENTRYID ),
- MAPIMACRO(PR_IPM_OUTBOX_ENTRYID ),
- MAPIMACRO(PR_IPM_WASTEBASKET_ENTRYID ),
- MAPIMACRO(PR_IPM_SENTMAIL_ENTRYID ),
- MAPIMACRO(PR_VIEWS_ENTRYID ),
- MAPIMACRO(PR_COMMON_VIEWS_ENTRYID ),
- MAPIMACRO(PR_FINDER_ENTRYID ),
- MAPIMACRO(PR_CONTAINER_FLAGS ),
- MAPIMACRO(PR_FOLDER_TYPE ),
- MAPIMACRO(PR_CONTENT_COUNT ),
- MAPIMACRO(PR_CONTENT_UNREAD ),
- MAPIMACRO(PR_CREATE_TEMPLATES ),
- MAPIMACRO(PR_DETAILS_TABLE ),
- MAPIMACRO(PR_SEARCH ),
- MAPIMACRO(PR_SELECTABLE ),
- MAPIMACRO(PR_SUBFOLDERS ),
- MAPIMACRO(PR_STATUS ),
- MAPIMACRO(PR_ANR ),
- MAPIMACRO(PR_CONTENTS_SORT_ORDER ),
- MAPIMACRO(PR_CONTAINER_HIERARCHY ),
- MAPIMACRO(PR_CONTAINER_CONTENTS ),
- MAPIMACRO(PR_FOLDER_ASSOCIATED_CONTENTS ),
- MAPIMACRO(PR_DEF_CREATE_DL ),
- MAPIMACRO(PR_DEF_CREATE_MAILUSER ),
- MAPIMACRO(PR_CONTAINER_CLASS ),
- MAPIMACRO(PR_CONTAINER_MODIFY_VERSION ),
- MAPIMACRO(PR_AB_PROVIDER_ID ),
- MAPIMACRO(PR_DEFAULT_VIEW_ENTRYID ),
- MAPIMACRO(PR_ASSOC_CONTENT_COUNT ),
- MAPIMACRO(PR_ATTACHMENT_X400_PARAMETERS ),
- MAPIMACRO(PR_ATTACH_DATA_OBJ ),
- MAPIMACRO(PR_ATTACH_ENCODING ),
- MAPIMACRO(PR_ATTACH_EXTENSION ),
- MAPIMACRO(PR_ATTACH_FILENAME ),
- MAPIMACRO(PR_ATTACH_METHOD ),
- MAPIMACRO(PR_ATTACH_LONG_FILENAME ),
- MAPIMACRO(PR_ATTACH_PATHNAME ),
- MAPIMACRO(PR_ATTACH_RENDERING ),
- MAPIMACRO(PR_ATTACH_TAG ),
- MAPIMACRO(PR_RENDERING_POSITION ),
- MAPIMACRO(PR_ATTACH_TRANSPORT_NAME ),
- MAPIMACRO(PR_ATTACH_LONG_PATHNAME ),
- MAPIMACRO(PR_ATTACH_MIME_TAG ),
- MAPIMACRO(PR_ATTACH_ADDITIONAL_INFO ),
- MAPIMACRO(PR_DISPLAY_TYPE ),
- MAPIMACRO(PR_TEMPLATEID ),
- MAPIMACRO(PR_PRIMARY_CAPABILITY ),
- MAPIMACRO(PR_7BIT_DISPLAY_NAME ),
- MAPIMACRO(PR_ACCOUNT ),
- MAPIMACRO(PR_ALTERNATE_RECIPIENT ),
- MAPIMACRO(PR_CALLBACK_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_CONVERSION_PROHIBITED ),
- MAPIMACRO(PR_DISCLOSE_RECIPIENTS ),
- MAPIMACRO(PR_GENERATION ),
- MAPIMACRO(PR_GIVEN_NAME ),
- MAPIMACRO(PR_GOVERNMENT_ID_NUMBER ),
- MAPIMACRO(PR_BUSINESS_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_HOME_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_INITIALS ),
- MAPIMACRO(PR_KEYWORD ),
- MAPIMACRO(PR_LANGUAGE ),
- MAPIMACRO(PR_LOCATION ),
- MAPIMACRO(PR_MAIL_PERMISSION ),
- MAPIMACRO(PR_MHS_COMMON_NAME ),
- MAPIMACRO(PR_ORGANIZATIONAL_ID_NUMBER ),
- MAPIMACRO(PR_SURNAME ),
- MAPIMACRO(PR_ORIGINAL_ENTRYID ),
- MAPIMACRO(PR_ORIGINAL_DISPLAY_NAME ),
- MAPIMACRO(PR_ORIGINAL_SEARCH_KEY ),
- MAPIMACRO(PR_POSTAL_ADDRESS ),
- MAPIMACRO(PR_COMPANY_NAME ),
- MAPIMACRO(PR_TITLE ),
- MAPIMACRO(PR_DEPARTMENT_NAME ),
- MAPIMACRO(PR_OFFICE_LOCATION ),
- MAPIMACRO(PR_PRIMARY_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_BUSINESS2_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_MOBILE_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_RADIO_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_CAR_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_OTHER_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_TRANSMITABLE_DISPLAY_NAME ),
- MAPIMACRO(PR_PAGER_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_USER_CERTIFICATE ),
- MAPIMACRO(PR_PRIMARY_FAX_NUMBER ),
- MAPIMACRO(PR_BUSINESS_FAX_NUMBER ),
- MAPIMACRO(PR_HOME_FAX_NUMBER ),
- MAPIMACRO(PR_COUNTRY ),
- MAPIMACRO(PR_LOCALITY ),
- MAPIMACRO(PR_STATE_OR_PROVINCE ),
- MAPIMACRO(PR_STREET_ADDRESS ),
- MAPIMACRO(PR_POSTAL_CODE ),
- MAPIMACRO(PR_POST_OFFICE_BOX ),
- MAPIMACRO(PR_TELEX_NUMBER ),
- MAPIMACRO(PR_ISDN_NUMBER ),
- MAPIMACRO(PR_ASSISTANT_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_HOME2_TELEPHONE_NUMBER ),
- MAPIMACRO(PR_ASSISTANT ),
- MAPIMACRO(PR_SEND_RICH_INFO ),
- MAPIMACRO(PR_WEDDING_ANNIVERSARY ),
- MAPIMACRO(PR_BIRTHDAY ),
- MAPIMACRO(PR_HOBBIES ),
- MAPIMACRO(PR_MIDDLE_NAME ),
- MAPIMACRO(PR_DISPLAY_NAME_PREFIX ),
- MAPIMACRO(PR_PROFESSION ),
- MAPIMACRO(PR_PREFERRED_BY_NAME ),
- MAPIMACRO(PR_SPOUSE_NAME ),
- MAPIMACRO(PR_COMPUTER_NETWORK_NAME ),
- MAPIMACRO(PR_CUSTOMER_ID ),
- MAPIMACRO(PR_TTYTDD_PHONE_NUMBER ),
- MAPIMACRO(PR_FTP_SITE ),
- MAPIMACRO(PR_GENDER ),
- MAPIMACRO(PR_MANAGER_NAME ),
- MAPIMACRO(PR_NICKNAME ),
- MAPIMACRO(PR_PERSONAL_HOME_PAGE ),
- MAPIMACRO(PR_BUSINESS_HOME_PAGE ),
- MAPIMACRO(PR_CONTACT_VERSION ),
- MAPIMACRO(PR_CONTACT_ENTRYIDS ),
- MAPIMACRO(PR_CONTACT_ADDRTYPES ),
- MAPIMACRO(PR_CONTACT_DEFAULT_ADDRESS_INDEX ),
- MAPIMACRO(PR_CONTACT_EMAIL_ADDRESSES ),
- MAPIMACRO(PR_COMPANY_MAIN_PHONE_NUMBER ),
- MAPIMACRO(PR_CHILDRENS_NAMES ),
- MAPIMACRO(PR_HOME_ADDRESS_CITY ),
- MAPIMACRO(PR_HOME_ADDRESS_COUNTRY ),
- MAPIMACRO(PR_HOME_ADDRESS_POSTAL_CODE ),
- MAPIMACRO(PR_HOME_ADDRESS_STATE_OR_PROVINCE ),
- MAPIMACRO(PR_HOME_ADDRESS_STREET ),
- MAPIMACRO(PR_HOME_ADDRESS_POST_OFFICE_BOX ),
- MAPIMACRO(PR_OTHER_ADDRESS_CITY ),
- MAPIMACRO(PR_OTHER_ADDRESS_COUNTRY ),
- MAPIMACRO(PR_OTHER_ADDRESS_POSTAL_CODE ),
- MAPIMACRO(PR_OTHER_ADDRESS_STATE_OR_PROVINCE ),
- MAPIMACRO(PR_OTHER_ADDRESS_STREET ),
- MAPIMACRO(PR_OTHER_ADDRESS_POST_OFFICE_BOX ),
- MAPIMACRO(PR_STORE_PROVIDERS ),
- MAPIMACRO(PR_AB_PROVIDERS ),
- MAPIMACRO(PR_TRANSPORT_PROVIDERS ),
- MAPIMACRO(PR_DEFAULT_PROFILE ),
- MAPIMACRO(PR_AB_SEARCH_PATH ),
- MAPIMACRO(PR_AB_DEFAULT_DIR ),
- MAPIMACRO(PR_AB_DEFAULT_PAB ),
- MAPIMACRO(PR_FILTERING_HOOKS ),
- MAPIMACRO(PR_SERVICE_NAME ),
- MAPIMACRO(PR_SERVICE_DLL_NAME ),
- MAPIMACRO(PR_SERVICE_ENTRY_NAME ),
- MAPIMACRO(PR_SERVICE_UID ),
- MAPIMACRO(PR_SERVICE_EXTRA_UIDS ),
- MAPIMACRO(PR_SERVICES ),
- MAPIMACRO(PR_SERVICE_SUPPORT_FILES ),
- MAPIMACRO(PR_SERVICE_DELETE_FILES ),
- MAPIMACRO(PR_AB_SEARCH_PATH_UPDATE ),
- MAPIMACRO(PR_PROFILE_NAME ),
- MAPIMACRO(PR_IDENTITY_DISPLAY ),
- MAPIMACRO(PR_IDENTITY_ENTRYID ),
- MAPIMACRO(PR_RESOURCE_METHODS ),
- MAPIMACRO(PR_RESOURCE_TYPE ),
- MAPIMACRO(PR_STATUS_CODE ),
- MAPIMACRO(PR_IDENTITY_SEARCH_KEY ),
- MAPIMACRO(PR_OWN_STORE_ENTRYID ),
- MAPIMACRO(PR_RESOURCE_PATH ),
- MAPIMACRO(PR_STATUS_STRING ),
- MAPIMACRO(PR_X400_DEFERRED_DELIVERY_CANCEL ),
- MAPIMACRO(PR_HEADER_FOLDER_ENTRYID ),
- MAPIMACRO(PR_REMOTE_PROGRESS ),
- MAPIMACRO(PR_REMOTE_PROGRESS_TEXT ),
- MAPIMACRO(PR_REMOTE_VALIDATE_OK ),
- MAPIMACRO(PR_CONTROL_FLAGS ),
- MAPIMACRO(PR_CONTROL_STRUCTURE ),
- MAPIMACRO(PR_CONTROL_TYPE ),
- MAPIMACRO(PR_DELTAX ),
- MAPIMACRO(PR_DELTAY ),
- MAPIMACRO(PR_XPOS ),
- MAPIMACRO(PR_YPOS ),
- MAPIMACRO(PR_CONTROL_ID ),
- MAPIMACRO(PR_INITIAL_DETAILS_PANE )};
-
-#endif /* MAPITAGS_H */
diff --git a/src/plugins/tnef_parse/tnef-errors.h b/src/plugins/tnef_parse/tnef-errors.h
deleted file mode 100644
index dc19e78..0000000
--- a/src/plugins/tnef_parse/tnef-errors.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-* Copyright (C) 2004-2014 Colin Leroy and the Claws Mail team
-*
-* Yerase's TNEF Stream Reader Library
-* Copyright (C) 2003 Randall E. Hand
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* You can contact me at randall.hand at gmail.com for questions or assistance
-*/
-#ifndef _TNEF_ERRORS_
-#define _TNEF_ERRORS_
-
-
-#define YTNEF_CANNOT_INIT_DATA -1
-#define YTNEF_NOT_TNEF_STREAM -2
-#define YTNEF_ERROR_READING_DATA -3
-#define YTNEF_NO_KEY -4
-#define YTNEF_BAD_CHECKSUM -5
-#define YTNEF_ERROR_IN_HANDLER -6
-#define YTNEF_UNKNOWN_PROPERTY -7
-#define YTNEF_INCORRECT_SETUP -8
-
-
-#endif
-
diff --git a/src/plugins/tnef_parse/tnef-types.h b/src/plugins/tnef_parse/tnef-types.h
deleted file mode 100644
index bd21147..0000000
--- a/src/plugins/tnef_parse/tnef-types.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
-* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-* Copyright (C) 2004-2014 Colin Leroy and the Claws Mail team
-*
-* Yerase's TNEF Stream Reader Library
-* Copyright (C) 2003 Randall E. Hand
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* You can contact me at randall.hand at gmail.com for questions or assistance
-*/
-#ifndef _TNEF_TYPES_H_
-#define _TNEF_TYPES_H_
-
-#define BYTE unsigned char
-#define WORD unsigned short int
-#define DWORD unsigned int
-#define ULONG unsigned int
-#define DDWORD unsigned long long
-typedef struct
-{
- WORD atyp;
- ULONG ulPosition;
- WORD dxWidth;
- WORD dyHeight;
- DWORD dwFlags;
-} renddata;
-
-/* ----------------------------------- */
-/* TNEF Down-level Date/Time Structure */
-/* ----------------------------------- */
-
-typedef struct
-{
- WORD wYear;
- WORD wMonth;
- WORD wDay;
- WORD wHour;
- WORD wMinute;
- WORD wSecond;
- WORD wDayOfWeek;
-} dtr;
-
-typedef struct
-{
- char *data;
- int size;
-} variableLength;
-
-typedef struct {
- DWORD custom;
- BYTE guid[16];
- DWORD id;
- ULONG count;
- int namedproperty;
- variableLength *propnames;
- variableLength *data;
-} MAPIProperty;
-
-typedef struct MAPIProps {
- DWORD count;
- MAPIProperty *properties;
-} MAPIProps;
-
-typedef struct Attachment
-{
- dtr Date;
- variableLength Title;
- variableLength MetaFile;
- dtr CreateDate;
- dtr ModifyDate;
- variableLength TransportFilename;
- renddata RenderData;
- MAPIProps MAPI;
- struct Attachment *next;
- variableLength FileData;
- variableLength IconData;
-} Attachment;
-
-typedef struct _TNEFIOStruct
-{
- int (*InitProc) (struct _TNEFIOStruct *IO);
- int (*ReadProc) (struct _TNEFIOStruct *IO, int size, int count, void *dest);
- int (*CloseProc) (struct _TNEFIOStruct *IO);
- void *data;
-} TNEFIOStruct;
-
-typedef struct
-{
- char *filename;
- FILE *fptr;
- int Debug;
-} TNEFFileInfo;
-
-typedef struct
-{
- BYTE *dataStart;
- BYTE *ptr;
- long size;
- int Debug;
-} TNEFMemInfo;
-
-typedef struct
-{
- char version[10];
- variableLength from;
- variableLength subject;
- dtr dateSent;
- dtr dateReceived;
- char messageStatus[10];
- char messageClass[50];
- char messageID[50];
- char parentID[50];
- char conversationID[50];
- variableLength body;
- char priority[10];
- Attachment starting_attach;
- dtr dateModified;
- MAPIProps MapiProperties;
- variableLength CodePage;
- variableLength OriginalMessageClass;
- variableLength Owner;
- variableLength SentFor;
- variableLength Delegate;
- dtr DateStart;
- dtr DateEnd;
- variableLength AidOwner;
- int RequestRes;
- int Debug;
- TNEFIOStruct IO;
-} TNEFStruct;
-
-#endif
diff --git a/src/plugins/tnef_parse/tnef_dump.c b/src/plugins/tnef_parse/tnef_dump.c
index 5a18f69..6bccbe7 100644
--- a/src/plugins/tnef_parse/tnef_dump.c
+++ b/src/plugins/tnef_parse/tnef_dump.c
@@ -33,6 +33,19 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+
+#ifdef YTNEF_H_SUBDIR
+#include <libytnef/tnef-types.h>
+#include <libytnef/ytnef.h>
+#include <libytnef/mapi.h>
+#include <libytnef/mapidefs.h>
+#else
+#include <tnef-types.h>
+#include <ytnef.h>
+#include <mapi.h>
+#include <mapidefs.h>
+#endif
+
#include "common/claws.h"
#include "common/version.h"
#include "main.h"
@@ -40,11 +53,6 @@
#include "procmime.h"
#include "utils.h"
-#include <tnef-types.h>
-#include <ytnef.h>
-#include <mapi.h>
-#include <mapidefs.h>
-
#include "tnef_dump.h"
#define PRODID "PRODID:-//The Gauntlet//" PACKAGE " TNEF Parser " VERSION "//EN\n"
@@ -553,7 +561,11 @@ gboolean SaveVCalendar(FILE *fptr, TNEFStruct *TNEF) {
if ((filename=MAPIFindUserProp(&(TNEF->MapiProperties),
PROP_TAG(PT_BOOLEAN, 0x8506))) != MAPI_UNDEFINED) {
ddword_ptr = (DDWORD*)filename->data;
+#ifdef YTNEF_OLD_SWAPDDWORD
ddword_val = SwapDDWord((BYTE*)ddword_ptr);
+#else
+ ddword_val = SwapDDWord((BYTE*)ddword_ptr, sizeof(DDWORD));
+#endif
fprintf(fptr, "CLASS:" );
if (ddword_val == 1) {
fprintf(fptr,"PRIVATE\n");
@@ -663,7 +675,11 @@ gboolean SaveVTask(FILE *fptr, TNEFStruct *TNEF) {
PROP_TAG(PT_BOOLEAN, 0x8506));
if (filename != MAPI_UNDEFINED) {
ddword_ptr = (DDWORD*)filename->data;
+#ifdef YTNEF_OLD_SWAPDDWORD
ddword_val = SwapDDWord((BYTE*)ddword_ptr);
+#else
+ ddword_val = SwapDDWord((BYTE*)ddword_ptr, sizeof(DDWORD));
+#endif
fprintf(fptr, "CLASS:" );
if (ddword_val == 1) {
fprintf(fptr,"PRIVATE\n");
diff --git a/src/plugins/tnef_parse/tnef_parse.c b/src/plugins/tnef_parse/tnef_parse.c
index a9f926f..6f0f86f 100644
--- a/src/plugins/tnef_parse/tnef_parse.c
+++ b/src/plugins/tnef_parse/tnef_parse.c
@@ -29,6 +29,19 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+
+#ifdef YTNEF_H_SUBDIR
+#include <libytnef/tnef-types.h>
+#include <libytnef/ytnef.h>
+#include <libytnef/mapi.h>
+#include <libytnef/mapidefs.h>
+#else
+#include <tnef-types.h>
+#include <ytnef.h>
+#include <mapi.h>
+#include <mapidefs.h>
+#endif
+
#include "common/claws.h"
#include "common/version.h"
#include "main.h"
@@ -36,11 +49,6 @@
#include "procmime.h"
#include "utils.h"
-#include <tnef-types.h>
-#include <ytnef.h>
-#include <mapi.h>
-#include <mapidefs.h>
-
#include "tnef_dump.h"
static MimeParser *tnef_parser = NULL;
diff --git a/src/plugins/tnef_parse/ytnef.c b/src/plugins/tnef_parse/ytnef.c
deleted file mode 100644
index df8da3a..0000000
--- a/src/plugins/tnef_parse/ytnef.c
+++ /dev/null
@@ -1,1434 +0,0 @@
-/*
- * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2008 Colin Leroy <colin at colino.net>
- * and the Claws Mail Team
- *
- * This file Copyright (C) 2002-2007 Randall Hand <yerase at yerot.com>
- * Thanks to him for allowing redistribution of this code as GPLv3.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#include "claws-features.h"
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include "ytnef.h"
-#include "tnef-errors.h"
-#include "mapi.h"
-#include "mapidefs.h"
-#include "mapitags.h"
-#include "config.h"
-
-#include <glib.h>
-#include <glib/gstdio.h>
-
-#define RTF_PREBUF "{\\rtf1\\ansi\\mac\\deff0\\deftab720{\\fonttbl;}{\\f0\\fnil \\froman \\fswiss \\fmodern \\fscript \\fdecor MS Sans SerifSymbolArialTimes New RomanCourier{\\colortbl\\red0\\green0\\blue0\n\r\\par \\pard\\plain\\f0\\fs20\\b\\i\\u\\tab\\tx"
-#define DEBUG(lvl, curlvl, msg) \
- if ((lvl) >= (curlvl)) \
- printf("DEBUG(%i/%i): %s\n", curlvl, lvl, msg);
-#define DEBUG1(lvl, curlvl, msg, var1) \
- if ((lvl) >= (curlvl)) { \
- printf("DEBUG(%i/%i):", curlvl, lvl); \
- printf(msg, var1); \
- printf("\n"); \
- }
-#define DEBUG2(lvl, curlvl, msg, var1, var2) \
- if ((lvl) >= (curlvl)) { \
- printf("DEBUG(%i/%i):", curlvl, lvl); \
- printf(msg, var1, var2); \
- printf("\n"); \
- }
-#define DEBUG3(lvl, curlvl, msg, var1, var2, var3) \
- if ((lvl) >= (curlvl)) { \
- printf("DEBUG(%i/%i):", curlvl, lvl); \
- printf(msg, var1, var2,var3); \
- printf("\n"); \
- }
-
-#ifndef MIN
-#define MIN(x,y) (((x)<(y))?(x):(y))
-#endif
-
-void TNEFFillMapi(TNEFStruct *TNEF, BYTE *data, DWORD size, MAPIProps *p);
-void SetFlip(void);
-
-int TNEFDefaultHandler STD_ARGLIST;
-int TNEFAttachmentFilename STD_ARGLIST;
-int TNEFAttachmentSave STD_ARGLIST;
-int TNEFDetailedPrint STD_ARGLIST;
-int TNEFHexBreakdown STD_ARGLIST;
-int TNEFBody STD_ARGLIST;
-int TNEFRendData STD_ARGLIST;
-int TNEFDateHandler STD_ARGLIST;
-int TNEFPriority STD_ARGLIST;
-int TNEFVersion STD_ARGLIST;
-int TNEFMapiProperties STD_ARGLIST;
-int TNEFIcon STD_ARGLIST;
-int TNEFSubjectHandler STD_ARGLIST;
-int TNEFFromHandler STD_ARGLIST;
-int TNEFRecipTable STD_ARGLIST;
-int TNEFAttachmentMAPI STD_ARGLIST;
-int TNEFSentFor STD_ARGLIST;
-int TNEFMessageClass STD_ARGLIST;
-int TNEFMessageID STD_ARGLIST;
-int TNEFParentID STD_ARGLIST;
-int TNEFOriginalMsgClass STD_ARGLIST;
-int TNEFCodePage STD_ARGLIST;
-
-
-BYTE *TNEFFileContents=NULL;
-DWORD TNEFFileContentsSize;
-BYTE *TNEFFileIcon=NULL;
-DWORD TNEFFileIconSize;
-
-TNEFHandler TNEFList[] = {
- {attNull, "Null", TNEFDefaultHandler},
- {attFrom, "From", TNEFFromHandler},
- {attSubject, "Subject", TNEFSubjectHandler},
- {attDateSent, "Date Sent", TNEFDateHandler},
- {attDateRecd, "Date Received", TNEFDateHandler},
- {attMessageStatus, "Message Status", TNEFDefaultHandler},
- {attMessageClass, "Message Class", TNEFMessageClass},
- {attMessageID, "Message ID", TNEFMessageID},
- {attParentID, "Parent ID", TNEFParentID},
- {attConversationID, "Conversation ID", TNEFDefaultHandler},
- {attBody, "Body", TNEFBody},
- {attPriority, "Priority", TNEFPriority},
- {attAttachData, "Attach Data", TNEFAttachmentSave},
- {attAttachTitle, "Attach Title", TNEFAttachmentFilename},
- {attAttachMetaFile, "Attach Meta-File", TNEFIcon},
- {attAttachCreateDate, "Attachment Create Date", TNEFDateHandler},
- {attAttachModifyDate, "Attachment Modify Date", TNEFDateHandler},
- {attDateModified, "Date Modified", TNEFDateHandler},
- {attAttachTransportFilename, "Attachment Transport name", TNEFDefaultHandler},
- {attAttachRenddata, "Attachment Display info", TNEFRendData},
- {attMAPIProps, "MAPI Properties", TNEFMapiProperties},
- {attRecipTable, "Recip Table", TNEFRecipTable},
- {attAttachment, "Attachment", TNEFAttachmentMAPI},
- {attTnefVersion, "TNEF Version", TNEFVersion},
- {attOemCodepage, "OEM CodePage", TNEFCodePage},
- {attOriginalMessageClass, "Original Message Class", TNEFOriginalMsgClass},
- {attOwner, "Owner", TNEFDefaultHandler},
- {attSentFor, "Sent For", TNEFSentFor},
- {attDelegate, "Delegate", TNEFDefaultHandler},
- {attDateStart, "Date Start", TNEFDateHandler},
- {attDateEnd, "Date End", TNEFDateHandler},
- {attAidOwner, "Aid Owner", TNEFDefaultHandler},
- {attRequestRes, "Request Response", TNEFDefaultHandler} };
-
-
-WORD SwapWord(BYTE *p)
-{
- WORD *word_ptr;
-#ifdef WORDS_BIGENDIAN
- BYTE bytes[2];
- bytes[0] = p[1];
- bytes[1] = p[0];
- word_ptr = (WORD*)&(bytes[0]);
-#else
- word_ptr = (WORD*)p;
-#endif
- return *word_ptr;
-}
-
-DWORD SwapDWord(BYTE *p)
-{
- DWORD *dword_ptr;
-#ifdef WORDS_BIGENDIAN
- BYTE bytes[4];
- bytes[0] = p[3];
- bytes[1] = p[2];
- bytes[2] = p[1];
- bytes[3] = p[0];
- dword_ptr = (DWORD*)&(bytes[0]);
-#else
- dword_ptr = (DWORD*)p;
-#endif
- return *dword_ptr;
-}
-
-DDWORD SwapDDWord(BYTE *p)
-{
- DDWORD *ddword_ptr;
-#ifdef WORDS_BIGENDIAN
- BYTE bytes[8];
- bytes[0] = p[7];
- bytes[1] = p[6];
- bytes[2] = p[5];
- bytes[3] = p[4];
- bytes[4] = p[3];
- bytes[5] = p[2];
- bytes[6] = p[1];
- bytes[7] = p[0];
- ddword_ptr = (DDWORD*)&(bytes[0]);
-#else
- ddword_ptr = (DDWORD*)p;
-#endif
- return *ddword_ptr;
-}
-
-/* convert 16-bit unicode to UTF8 unicode */
-char* to_utf8(int len, char* buf)
-{
- int i, j = 0;
- /* worst case length */
- char *utf8 = malloc(3 * len/2 + 1);
-
- for (i=0; i<len-1; i+=2) {
- unsigned int c = SwapWord(buf+i);
- if (c <= 0x007f) {
- utf8[j++] = 0x00 | ((c & 0x007f) >> 0);
- }
- else if (c < 0x07ff) {
- utf8[j++] = 0xc0 | ((c & 0x07c0) >> 6);
- utf8[j++] = 0x80 | ((c & 0x003f) >> 0);
- }
- else {
- utf8[j++] = 0xe0 | ((c & 0xf000) >> 12);
- utf8[j++] = 0x80 | ((c & 0x0fc0) >> 6);
- utf8[j++] = 0x80 | ((c & 0x003f) >> 0);
- }
- }
-
- /* just in case the original was not null terminated */
- utf8[j++] = '\0';
-
- return utf8;
-}
-
-
-// -----------------------------------------------------------------------------
-int TNEFDefaultHandler STD_ARGLIST {
- if (TNEF->Debug >= 1)
- printf("%s: [%i] %s\n", TNEFList[id].name, size, data);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFCodePage STD_ARGLIST {
- TNEF->CodePage.size = size;
- TNEF->CodePage.data = calloc(size, sizeof(BYTE));
- memcpy(TNEF->CodePage.data, data, size);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFParentID STD_ARGLIST {
- memcpy(TNEF->parentID, data, MIN(size,sizeof(TNEF->parentID)));
- return 0;
-}
-// -----------------------------------------------------------------------------
-int TNEFMessageID STD_ARGLIST {
- memcpy(TNEF->messageID, data, MIN(size,sizeof(TNEF->messageID)));
- return 0;
-}
-// -----------------------------------------------------------------------------
-int TNEFBody STD_ARGLIST {
- TNEF->body.size = size;
- TNEF->body.data = calloc(size, sizeof(BYTE));
- memcpy(TNEF->body.data, data, size);
- return 0;
-}
-// -----------------------------------------------------------------------------
-int TNEFOriginalMsgClass STD_ARGLIST {
- TNEF->OriginalMessageClass.size = size;
- TNEF->OriginalMessageClass.data = calloc(size, sizeof(BYTE));
- memcpy(TNEF->OriginalMessageClass.data, data, size);
- return 0;
-}
-// -----------------------------------------------------------------------------
-int TNEFMessageClass STD_ARGLIST {
- memcpy(TNEF->messageClass, data, MIN(size,sizeof(TNEF->messageClass)));
- return 0;
-}
-// -----------------------------------------------------------------------------
-int TNEFFromHandler STD_ARGLIST {
- TNEF->from.data = calloc(size, sizeof(BYTE));
- TNEF->from.size = size;
- memcpy(TNEF->from.data, data,size);
- return 0;
-}
-// -----------------------------------------------------------------------------
-int TNEFSubjectHandler STD_ARGLIST {
- TNEF->subject.data = calloc(size, sizeof(BYTE));
- TNEF->subject.size = size;
- memcpy(TNEF->subject.data, data,size);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFRendData STD_ARGLIST {
- Attachment *p;
- // Find the last attachment.
- p = &(TNEF->starting_attach);
- while (p->next!=NULL) p=p->next;
-
- // Add a new one
- p->next = calloc(1,sizeof(Attachment));
- p=p->next;
-
- TNEFInitAttachment(p);
-
- memcpy(&(p->RenderData), data, sizeof(renddata));
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFVersion STD_ARGLIST {
- WORD major;
- WORD minor;
- major = SwapWord(data+2);
- minor = SwapWord(data);
-
- sprintf(TNEF->version, "TNEF%i.%i", major, minor);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFIcon STD_ARGLIST {
- Attachment *p;
- // Find the last attachment.
- p = &(TNEF->starting_attach);
- while (p->next!=NULL) p=p->next;
-
- p->IconData.size = size;
- p->IconData.data = calloc(size, sizeof(BYTE));
- memcpy(p->IconData.data, data, size);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFRecipTable STD_ARGLIST {
- BYTE *d;
-
- d = data;
- SwapDWord(d);
- d += 4;
-// printf("Recipient Table containing %u rows\n", count);
-
- return 0;
-}
-// -----------------------------------------------------------------------------
-int TNEFAttachmentMAPI STD_ARGLIST {
- Attachment *p;
- // Find the last attachment.
- //
- p = &(TNEF->starting_attach);
- while (p->next!=NULL) p=p->next;
- TNEFFillMapi(TNEF, data, size, &(p->MAPI));
-
- return 0;
-}
-// -----------------------------------------------------------------------------
-int TNEFMapiProperties STD_ARGLIST {
- TNEFFillMapi(TNEF, data, size, &(TNEF->MapiProperties));
- return 0;
-}
-
-void TNEFFillMapi(TNEFStruct *TNEF, BYTE *data, DWORD size, MAPIProps *p) {
- int i,j;
- DWORD num;
- BYTE *d;
- MAPIProperty *mp;
- DWORD type;
- DWORD length;
- variableLength *vl;
-
- WORD temp_word;
- DWORD temp_dword;
- DDWORD temp_ddword;
- int count=-1;
-
- d = data;
- p->count = SwapDWord(data);
- d += 4;
- p->properties = calloc(p->count, sizeof(MAPIProperty));
- mp = p->properties;
-
- for(i=0; i<p->count; i++) {
- if (count == -1) {
- mp->id = SwapDWord(d);
- d+=4;
- mp->custom = 0;
- mp->count = 1;
- mp->namedproperty = 0;
- length = -1;
- if (PROP_ID(mp->id) >= 0x8000) {
- // Read the GUID
- memcpy(&(mp->guid[0]), d, 16);
- d+=16;
-
- length = SwapDWord(d);
- d+=sizeof(DWORD);
- if (length > 0) {
- mp->namedproperty = length;
- mp->propnames = calloc(length, sizeof(variableLength));
- while (length > 0) {
- type = SwapDWord(d);
- mp->propnames[length-1].data = calloc(type, sizeof(BYTE));
- mp->propnames[length-1].size = type;
- d+=4;
- for(j=0; j<(type>>1); j++) {
- mp->propnames[length-1].data[j] = d[j*2];
- }
- d += type + ((type % 4) ? (4 - type%4) : 0);
- length--;
- }
- } else {
- // READ the type
- type = SwapDWord(d);
- d+=sizeof(DWORD);
- mp->id = PROP_TAG(PROP_TYPE(mp->id), type);
- }
- mp->custom = 1;
- }
-
- //printf("Type id = %04x\n", PROP_TYPE(mp->id));
- if (PROP_TYPE(mp->id) & MV_FLAG) {
- mp->id = PROP_TAG(PROP_TYPE(mp->id) - MV_FLAG, PROP_ID(mp->id));
- mp->count = SwapDWord(d);
- d+=4;
- count = 0;
- }
- mp->data = calloc(mp->count, sizeof(variableLength));
- vl = mp->data;
- } else {
- i--;
- count++;
- vl = &(mp->data[count]);
- }
-
- switch (PROP_TYPE(mp->id)) {
- case PT_BINARY:
- case PT_OBJECT:
- case PT_STRING8:
- case PT_UNICODE:
- // First number of objects (assume 1 for now)
- if (count == -1) {
- vl->size = SwapDWord(d);
- d+=4;
- }
- // now size of object
- vl->size = SwapDWord(d);
- d+=4;
-
- // now actual object
- if (PROP_TYPE(mp->id) == PT_UNICODE) {
- vl->data = to_utf8(vl->size, d);
- }
- else {
- vl->data = calloc(vl->size, sizeof(BYTE));
- memcpy(vl->data, d, vl->size);
- }
-
- // Make sure to read in a multiple of 4
- num = vl->size;
- d += num + ((num % 4) ? (4 - num%4) : 0);
- break;
-
- case PT_CLSID:
- vl->size = 16; /* Size of struct GUID */
- vl->data = calloc(vl->size, sizeof(WORD));
- memcpy(vl->data, &d, vl->size);
- d += 16; /* Size of struct GUID */
- break;
-
- case PT_I2:
- // Read in 2 bytes, but proceed by 4 bytes
- vl->size = 2;
- vl->data = calloc(vl->size, sizeof(WORD));
- temp_word = SwapWord(d);
- memcpy(vl->data, &temp_word, vl->size);
- d += 4;
- break;
- case PT_BOOLEAN:
- case PT_LONG:
- case PT_R4:
- case PT_CURRENCY:
- case PT_APPTIME:
- case PT_ERROR:
- vl->size = 4;
- vl->data = calloc(vl->size, sizeof(BYTE));
- temp_dword = SwapDWord(d);
- memcpy(vl->data, &temp_dword, vl->size);
- d += 4;
- break;
- case PT_DOUBLE:
- case PT_I8:
- case PT_SYSTIME:
- vl->size = 8;
- vl->data = calloc(vl->size, sizeof(BYTE));
- temp_ddword = SwapDDWord(d);
- memcpy(vl->data, &temp_ddword, vl->size);
- d+=8;
- break;
- default:
- fprintf(stderr, "%s: Fatal BUG: unknown MAPI ID type (%u), (%u)\n", __func__, PROP_TYPE(mp->id), mp->id);
- }
- if (count == (mp->count-1)) {
- count = -1;
- }
- if (count == -1) {
- mp++;
- }
- }
- if ((d-data) < size) {
- if (TNEF->Debug >= 1) {
- printf("ERROR DURING MAPI READ\n");
- printf("Read %ld bytes, Expected %u bytes\n", (d-data), size);
- printf("%ld bytes missing\n", size - (d-data));
- }
- } else if ((d-data) > size){
- if (TNEF->Debug >= 1) {
- printf("ERROR DURING MAPI READ\n");
- printf("Read %ld bytes, Expected %u bytes\n", (d-data), size);
- printf("%ld bytes extra\n", (d-data)-size);
- }
- }
- return;
-}
-// -----------------------------------------------------------------------------
-int TNEFSentFor STD_ARGLIST {
- WORD name_length, addr_length;
- BYTE *d;
-
- d=data;
-
- while ((d-data)<size) {
- name_length = SwapWord(d);
- d+=sizeof(WORD);
- if (TNEF->Debug >= 1)
- printf("Sent For : %s", d);
- d+=name_length;
-
- addr_length = SwapWord(d);
- d+=sizeof(WORD);
- if (TNEF->Debug >= 1)
- printf("<%s>\n", d);
- d+=addr_length;
- }
- return 0;
-}
-// -----------------------------------------------------------------------------
-int TNEFDateHandler STD_ARGLIST {
- dtr *Date;
- Attachment *p;
- WORD *tmp_src, *tmp_dst;
- int i;
-
- p = &(TNEF->starting_attach);
- switch (TNEFList[id].id) {
- case attDateSent: Date = &(TNEF->dateSent); break;
- case attDateRecd: Date = &(TNEF->dateReceived); break;
- case attDateModified: Date = &(TNEF->dateModified); break;
- case attDateStart: Date = &(TNEF->DateStart); break;
- case attDateEnd: Date = &(TNEF->DateEnd); break;
- case attAttachCreateDate:
- while (p->next!=NULL) p=p->next;
- Date = &(p->CreateDate);
- break;
- case attAttachModifyDate:
- while (p->next!=NULL) p=p->next;
- Date = &(p->ModifyDate);
- break;
- default:
- if (TNEF->Debug >= 1)
- printf("MISSING CASE\n");
- return YTNEF_UNKNOWN_PROPERTY;
- }
-
- tmp_src = (WORD*)data;
- tmp_dst = (WORD*)Date;
- for(i=0;i<sizeof(dtr)/sizeof(WORD);i++) {
- *tmp_dst++ = SwapWord((BYTE*)tmp_src++);
- }
- return 0;
-}
-
-void TNEFPrintDate(dtr Date) {
- char days[7][15] = {"Sunday", "Monday", "Tuesday",
- "Wednesday", "Thursday", "Friday", "Saturday"};
- char months[12][15] = {"January", "February", "March", "April", "May",
- "June", "July", "August", "September", "October", "November",
- "December"};
-
- if (Date.wDayOfWeek < 7)
- printf("%s ", days[Date.wDayOfWeek]);
-
- if ((Date.wMonth < 13) && (Date.wMonth>0))
- printf("%s ", months[Date.wMonth-1]);
-
- printf("%hu, %hu ", Date.wDay, Date.wYear);
-
- if (Date.wHour>12)
- printf("%hu:%02hu:%02hu pm", (Date.wHour-12),
- Date.wMinute, Date.wSecond);
- else if (Date.wHour == 12)
- printf("%hu:%02hu:%02hu pm", (Date.wHour),
- Date.wMinute, Date.wSecond);
- else
- printf("%hu:%02hu:%02hu am", Date.wHour,
- Date.wMinute, Date.wSecond);
-}
-// -----------------------------------------------------------------------------
-int TNEFHexBreakdown STD_ARGLIST {
- int i;
- if (TNEF->Debug == 0)
- return 0;
-
- printf("%s: [%i bytes] \n", TNEFList[id].name, size);
-
- for(i=0; i<size; i++) {
- printf("%02x ", data[i]);
- if ((i+1)%16 == 0) printf("\n");
- }
- printf("\n");
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFDetailedPrint STD_ARGLIST {
- int i;
- if (TNEF->Debug == 0)
- return 0;
-
- printf("%s: [%i bytes] \n", TNEFList[id].name, size);
-
- for(i=0; i<size; i++) {
- printf("%c", data[i]);
- }
- printf("\n");
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFAttachmentFilename STD_ARGLIST {
- Attachment *p;
- p = &(TNEF->starting_attach);
- while (p->next!=NULL) p=p->next;
-
- p->Title.size = size;
- p->Title.data = calloc(size, sizeof(BYTE));
- memcpy(p->Title.data, data, size);
-
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFAttachmentSave STD_ARGLIST {
- Attachment *p;
- p = &(TNEF->starting_attach);
- while (p->next!=NULL) p=p->next;
-
- p->FileData.data = calloc(sizeof(unsigned char), size);
- p->FileData.size = size;
-
- memcpy(p->FileData.data, data, size);
-
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFPriority STD_ARGLIST {
- DWORD value;
-
- value = SwapDWord(data);
- switch (value) {
- case 3:
- sprintf((TNEF->priority), "high");
- break;
- case 2:
- sprintf((TNEF->priority), "normal");
- break;
- case 1:
- sprintf((TNEF->priority), "low");
- break;
- default:
- sprintf((TNEF->priority), "N/A");
- break;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFCheckForSignature(DWORD sig) {
- DWORD signature = 0x223E9F78;
-
- sig = SwapDWord((BYTE*)&sig);
-
- if (signature == sig) {
- return 0;
- } else {
- return YTNEF_NOT_TNEF_STREAM;
- }
-}
-
-// -----------------------------------------------------------------------------
-int TNEFGetKey(TNEFStruct *TNEF, WORD *key) {
- if (TNEF->IO.ReadProc (&(TNEF->IO), sizeof(WORD),1, key) < 1) {
- if (TNEF->Debug >= 1)
- printf("Error reading Key\n");
- return YTNEF_ERROR_READING_DATA;
- }
- *key = SwapWord((BYTE*)key);
-
- DEBUG1(TNEF->Debug, 2, "Key = %i", *key);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFGetHeader(TNEFStruct *TNEF, DWORD *type, DWORD *size) {
- BYTE component;
-
- DEBUG(TNEF->Debug, 2, "About to read Component");
- if (TNEF->IO.ReadProc(&(TNEF->IO), sizeof(BYTE),1, &component) < 1) {
- return YTNEF_ERROR_READING_DATA;
- }
-
-
- DEBUG(TNEF->Debug, 2, "About to read type");
- if (TNEF->IO.ReadProc(&(TNEF->IO), sizeof(DWORD), 1, type) < 1) {
- if (TNEF->Debug >= 1)
- printf("ERROR: Error reading type\n");
- return YTNEF_ERROR_READING_DATA;
- }
- DEBUG1(TNEF->Debug, 2, "Type = %i", *type);
-
-
- DEBUG(TNEF->Debug, 2, "About to read size");
- if (TNEF->IO.ReadProc(&(TNEF->IO), sizeof(DWORD), 1, size) < 1) {
- if (TNEF->Debug >= 1)
- printf("ERROR: Error reading size\n");
- return YTNEF_ERROR_READING_DATA;
- }
-
-
- DEBUG1(TNEF->Debug, 2, "Size = %i", *size);
-
- *type = SwapDWord((BYTE*)type);
- *size = SwapDWord((BYTE*)size);
-
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-int TNEFRawRead(TNEFStruct *TNEF, BYTE *data, DWORD size, WORD *checksum) {
- WORD temp;
- int i;
-
- if (TNEF->IO.ReadProc(&TNEF->IO, sizeof(BYTE), size, data) < size) {
- if (TNEF->Debug >= 1)
- printf("ERROR: Error reading data\n");
- return YTNEF_ERROR_READING_DATA;
- }
-
-
- if (checksum != NULL) {
- *checksum = 0;
- for(i=0; i<size; i++) {
- temp = data[i];
- *checksum = (*checksum + temp);
- }
- }
- return 0;
-}
-
-#define INITVARLENGTH(x) (x).data = NULL; (x).size = 0;
-#define INITDTR(x) (x).wYear=0; (x).wMonth=0; (x).wDay=0; \
- (x).wHour=0; (x).wMinute=0; (x).wSecond=0; \
- (x).wDayOfWeek=0;
-#define INITSTR(x) memset((x), 0, sizeof(x));
-void TNEFInitMapi(MAPIProps *p)
-{
- p->count = 0;
- p->properties = NULL;
-}
-
-void TNEFInitAttachment(Attachment *p)
-{
- INITDTR(p->Date);
- INITVARLENGTH(p->Title);
- INITVARLENGTH(p->MetaFile);
- INITDTR(p->CreateDate);
- INITDTR(p->ModifyDate);
- INITVARLENGTH(p->TransportFilename);
- INITVARLENGTH(p->FileData);
- INITVARLENGTH(p->IconData);
- memset(&(p->RenderData), 0, sizeof(renddata));
- TNEFInitMapi(&(p->MAPI));
- p->next = NULL;
-}
-
-void TNEFInitialize(TNEFStruct *TNEF)
-{
- INITSTR(TNEF->version);
- INITVARLENGTH(TNEF->from);
- INITVARLENGTH(TNEF->subject);
- INITDTR(TNEF->dateSent);
- INITDTR(TNEF->dateReceived);
-
- INITSTR(TNEF->messageStatus);
- INITSTR(TNEF->messageClass);
- INITSTR(TNEF->messageID);
- INITSTR(TNEF->parentID);
- INITSTR(TNEF->conversationID);
- INITVARLENGTH(TNEF->body);
- INITSTR(TNEF->priority);
- TNEFInitAttachment(&(TNEF->starting_attach));
- INITDTR(TNEF->dateModified);
- TNEFInitMapi(&(TNEF->MapiProperties));
- INITVARLENGTH(TNEF->CodePage);
- INITVARLENGTH(TNEF->OriginalMessageClass);
- INITVARLENGTH(TNEF->Owner);
- INITVARLENGTH(TNEF->SentFor);
- INITVARLENGTH(TNEF->Delegate);
- INITDTR(TNEF->DateStart);
- INITDTR(TNEF->DateEnd);
- INITVARLENGTH(TNEF->AidOwner);
- TNEF->RequestRes=0;
- TNEF->IO.data = NULL;
- TNEF->IO.InitProc = NULL;
- TNEF->IO.ReadProc = NULL;
- TNEF->IO.CloseProc = NULL;
-}
-#undef INITVARLENGTH
-#undef INITDTR
-#undef INITSTR
-
-#define FREEVARLENGTH(x) if ((x).size > 0) { \
- free((x).data); (x).size =0; }
-void TNEFFree(TNEFStruct *TNEF) {
- Attachment *p, *store;
-
- FREEVARLENGTH(TNEF->from);
- FREEVARLENGTH(TNEF->subject);
- FREEVARLENGTH(TNEF->body);
- FREEVARLENGTH(TNEF->CodePage);
- FREEVARLENGTH(TNEF->OriginalMessageClass);
- FREEVARLENGTH(TNEF->Owner);
- FREEVARLENGTH(TNEF->SentFor);
- FREEVARLENGTH(TNEF->Delegate);
- FREEVARLENGTH(TNEF->AidOwner);
- TNEFFreeMapiProps(&(TNEF->MapiProperties));
-
- p = TNEF->starting_attach.next;
- while (p != NULL) {
- TNEFFreeAttachment(p);
- store = p->next;
- free(p);
- p=store;
- }
-}
-
-void TNEFFreeAttachment(Attachment *p)
-{
- FREEVARLENGTH(p->Title);
- FREEVARLENGTH(p->MetaFile);
- FREEVARLENGTH(p->TransportFilename);
- FREEVARLENGTH(p->FileData);
- FREEVARLENGTH(p->IconData);
- TNEFFreeMapiProps(&(p->MAPI));
-}
-
-void TNEFFreeMapiProps(MAPIProps *p)
-{
- int i,j;
- for(i=0; i<p->count; i++) {
- for(j=0; j<p->properties[i].count; j++) {
- FREEVARLENGTH(p->properties[i].data[j]);
- }
- free(p->properties[i].data);
- }
- free(p->properties);
- p->count = 0;
-}
-#undef FREEVARLENGTH
-
-// Procedures to handle File IO
-int TNEFFile_Open (TNEFIOStruct *IO) {
- TNEFFileInfo *finfo;
- finfo = (TNEFFileInfo*)IO->data;
-
- DEBUG1(finfo->Debug, 3, "Opening %s", finfo->filename);
- if ((finfo->fptr = g_fopen(finfo->filename, "rb")) == NULL) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int TNEFFile_Read (TNEFIOStruct *IO, int size, int count, void *dest) {
- TNEFFileInfo *finfo;
- finfo = (TNEFFileInfo*)IO->data;
-
- DEBUG2(finfo->Debug, 3, "Reading %i blocks of %i size", count, size);
- if (finfo->fptr != NULL) {
- return fread((BYTE*)dest, size, count, finfo->fptr);
- } else {
- return -1;
- }
-}
-
-int TNEFFile_Close (TNEFIOStruct *IO) {
- TNEFFileInfo *finfo;
- finfo = (TNEFFileInfo*)IO->data;
-
- DEBUG1(finfo->Debug, 3, "Closing file %s", finfo->filename);
- if (finfo->fptr != NULL) {
- fclose(finfo->fptr);
- finfo->fptr = NULL;
- }
- return 0;
-}
-
-int TNEFParseFile(char *filename, TNEFStruct *TNEF) {
- TNEFFileInfo finfo;
-
- if (TNEF->Debug >= 1)
- printf("Attempting to parse %s...\n", filename);
-
-
- finfo.filename = filename;
- finfo.fptr = NULL;
- finfo.Debug = TNEF->Debug;
- TNEF->IO.data = (void*)&finfo;
- TNEF->IO.InitProc = TNEFFile_Open;
- TNEF->IO.ReadProc = TNEFFile_Read;
- TNEF->IO.CloseProc = TNEFFile_Close;
- return TNEFParse(TNEF);
-}
-//-------------------------------------------------------------
-// Procedures to handle Memory IO
-int TNEFMemory_Open (TNEFIOStruct *IO) {
- TNEFMemInfo *minfo;
- minfo = (TNEFMemInfo*)IO->data;
-
- minfo->ptr = minfo->dataStart;
- return 0;
-}
-
-int TNEFMemory_Read (TNEFIOStruct *IO, int size, int count, void *dest) {
- TNEFMemInfo *minfo;
- int length;
- long max;
- minfo = (TNEFMemInfo*)IO->data;
-
- length = count*size;
- max = (minfo->dataStart + minfo->size) - (minfo->ptr);
- if (length > max) {
- return -1;
- }
-
- DEBUG1(minfo->Debug, 3, "Copying %i bytes", length);
-
- memcpy(dest, minfo->ptr, length);
- minfo->ptr+=length;
- return count;
-}
-
-int TNEFMemory_Close (TNEFIOStruct *IO) {
- // Do nothing, really...
- return 0;
-}
-
-int TNEFParseMemory(BYTE *memory, long size, TNEFStruct *TNEF) {
- TNEFMemInfo minfo;
-
- DEBUG(TNEF->Debug, 1, "Attempting to parse memory block...\n");
-
- minfo.dataStart = memory;
- minfo.ptr = memory;
- minfo.size = size;
- minfo.Debug = TNEF->Debug;
- TNEF->IO.data = (void*)&minfo;
- TNEF->IO.InitProc = TNEFMemory_Open;
- TNEF->IO.ReadProc = TNEFMemory_Read;
- TNEF->IO.CloseProc = TNEFMemory_Close;
- return TNEFParse(TNEF);
-}
-
-
-int TNEFParse(TNEFStruct *TNEF) {
- WORD key;
- DWORD type;
- DWORD size;
- DWORD signature;
- BYTE *data;
- WORD checksum, header_checksum;
- int i;
-
- if (TNEF->IO.ReadProc == NULL) {
- printf("ERROR: Setup incorrectly: No ReadProc\n");
- return YTNEF_INCORRECT_SETUP;
- }
-
- if (TNEF->IO.InitProc != NULL) {
- DEBUG(TNEF->Debug, 2, "About to initialize");
- if (TNEF->IO.InitProc (&TNEF->IO) != 0) {
- return YTNEF_CANNOT_INIT_DATA;
- }
- DEBUG(TNEF->Debug, 2, "Initialization finished");
- }
-
- DEBUG(TNEF->Debug, 2, "Reading Signature");
- if (TNEF->IO.ReadProc (&TNEF->IO, sizeof(DWORD), 1, &signature) < 1) {
- printf("ERROR: Error reading signature\n");
- if (TNEF->IO.CloseProc != NULL) {
- TNEF->IO.CloseProc (&TNEF->IO);
- }
- return YTNEF_ERROR_READING_DATA;
- }
-
- DEBUG(TNEF->Debug, 2, "Checking Signature");
- if (TNEFCheckForSignature(signature) < 0) {
- printf("ERROR: Signature does not match. Not TNEF.\n");
- if (TNEF->IO.CloseProc != NULL) {
- TNEF->IO.CloseProc (&TNEF->IO);
- }
- return YTNEF_NOT_TNEF_STREAM;
- }
-
- DEBUG(TNEF->Debug, 2, "Reading Key.");
-
- if (TNEFGetKey(TNEF, &key) < 0) {
- printf("ERROR: Unable to retrieve key.\n");
- if (TNEF->IO.CloseProc != NULL) {
- TNEF->IO.CloseProc (&TNEF->IO);
- }
- return YTNEF_NO_KEY;
- }
-
- DEBUG(TNEF->Debug, 2, "Starting Full Processing.");
-
- while (TNEFGetHeader(TNEF, &type, &size) == 0) {
- DEBUG2(TNEF->Debug, 2, "Header says type=%i, size=%i", type, size);
- if (size > 0) {
- data = calloc(size, sizeof(BYTE));
- if (TNEFRawRead(TNEF, data, size, &header_checksum)< 0) {
- printf("ERROR: Unable to read data.\n");
- if (TNEF->IO.CloseProc != NULL) {
- TNEF->IO.CloseProc (&TNEF->IO);
- }
- free(data);
- return YTNEF_ERROR_READING_DATA;
- }
- if (TNEFRawRead(TNEF, (BYTE *)&checksum, 2, NULL) < 0) {
- printf("ERROR: Unable to read checksum.\n");
- if (TNEF->IO.CloseProc != NULL) {
- TNEF->IO.CloseProc (&TNEF->IO);
- }
- free(data);
- return YTNEF_ERROR_READING_DATA;
- }
- checksum = SwapWord((BYTE*)&checksum);
- if (checksum != header_checksum) {
- printf("ERROR: Checksum mismatch. Data corruption?:\n");
- if (TNEF->IO.CloseProc != NULL) {
- TNEF->IO.CloseProc (&TNEF->IO);
- }
- free(data);
- return YTNEF_BAD_CHECKSUM;
- }
- for(i=0; i<(sizeof(TNEFList)/sizeof(TNEFHandler));i++) {
- if (TNEFList[i].id == type) {
- if (TNEFList[i].handler != NULL) {
- if (TNEFList[i].handler(TNEF, i, data, size) < 0) {
- free(data);
- if (TNEF->IO.CloseProc != NULL) {
- TNEF->IO.CloseProc (&TNEF->IO);
- }
- return YTNEF_ERROR_IN_HANDLER;
- }
- } else {
- DEBUG2(TNEF->Debug, 1, "No handler for %s: %i bytes",
- TNEFList[i].name, size);
- }
- }
- }
-
- free(data);
- }
- }
-
- if (TNEF->IO.CloseProc != NULL) {
- TNEF->IO.CloseProc (&TNEF->IO);
- }
- return 0;
-
-}
-
-// ----------------------------------------------------------------------------
-
-variableLength *MAPIFindUserProp(MAPIProps *p, unsigned int ID)
-{
- int i;
- if (p != NULL) {
- for(i=0;i<p->count; i++) {
- if ((p->properties[i].id == ID) && (p->properties[i].custom == 1)) {
- return (p->properties[i].data);
- }
- }
- }
- return MAPI_UNDEFINED;
-}
-
-variableLength *MAPIFindProperty(MAPIProps *p, unsigned int ID)
-{
- int i;
- if (p != NULL) {
- for(i=0;i<p->count; i++) {
- if ((p->properties[i].id == ID) && (p->properties[i].custom == 0)) {
- return (p->properties[i].data);
- }
- }
- }
- return MAPI_UNDEFINED;
-}
-
-int MAPISysTimetoDTR(BYTE *data, dtr *thedate)
-{
- DDWORD ddword_tmp;
- int startingdate = 0;
- int tmp_date;
- int days_in_year = 365;
- unsigned int months[] = {31,28,31,30,31,30,31,31,30,31,30,31};
-
- ddword_tmp = *((DDWORD*)data);
- ddword_tmp = ddword_tmp /10; // micro-s
- ddword_tmp /= 1000; // ms
- ddword_tmp /= 1000; // s
-
- thedate->wSecond = (ddword_tmp % 60);
-
- ddword_tmp /= 60; // seconds to minutes
- thedate->wMinute = (ddword_tmp % 60);
-
- ddword_tmp /= 60; //minutes to hours
- thedate->wHour = (ddword_tmp % 24);
-
- ddword_tmp /= 24; // Hours to days
-
- // Now calculate the year based on # of days
- thedate->wYear = 1601;
- startingdate = 1;
- while(ddword_tmp >= days_in_year) {
- ddword_tmp-=days_in_year;
- thedate->wYear++;
- days_in_year = 365;
- startingdate++;
- if ((thedate->wYear % 4) == 0) {
- if ((thedate->wYear % 100) == 0) {
- // if the year is 1700,1800,1900, etc, then it is only
- // a leap year if exactly divisible by 400, not 4.
- if ((thedate->wYear % 400) == 0) {
- startingdate++;
- days_in_year = 366;
- }
- } else {
- startingdate++;
- days_in_year = 366;
- }
- }
- startingdate %= 7;
- }
-
- // the remaining number is the day # in this year
- // So now calculate the Month, & Day of month
- if ((thedate->wYear % 4) == 0) {
- // 29 days in february in a leap year
- months[1] = 29;
- }
-
- tmp_date = (int)ddword_tmp;
- thedate->wDayOfWeek = (tmp_date + startingdate) % 7;
- thedate->wMonth = 0;
-
- while (tmp_date > months[thedate->wMonth]) {
- tmp_date -= months[thedate->wMonth];
- thedate->wMonth++;
- }
- thedate->wMonth++;
- thedate->wDay = tmp_date+1;
- return 0;
-}
-
-int IsCompressedRTF(variableLength *p) {
-/*
- unsigned int in;
- unsigned char *src;
- ULONG compressedSize, uncompressedSize, magic, crc32;
-
- src = p->data;
- in = 0;
-
- compressedSize = (ULONG)SwapDWord(src+in);
- in += 4;
- uncompressedSize = (ULONG)SwapDWord(src+in);
- in += 4;
- magic = SwapDWord(src+in);
- in += 4;
- crc32 = SwapDWord(src+in);
- in += 4;
-
- if (magic == 0x414c454d) {
- return 1;
- } else if (magic == 0x75465a4c) {
- return 1;
- } else {
- return 0;
- }
-*/
- unsigned char *src = p->data;
- ULONG magic = SwapDWord(src + 8);
-
- if (magic == 0x414c454d || magic == 0x75465a4c)
- return 1;
-
- return 0;
-}
-
-void MAPIPrint(MAPIProps *p)
-{
- int j, i,index, h;
- dtr thedate;
- MAPIProperty *mapi;
- variableLength *mapidata;
- variableLength vlTemp;
- int found;
-
- for(j=0; j<p->count; j++) {
- mapi = &(p->properties[j]);
- printf(" #%i: Type: [", j);
- switch (PROP_TYPE(mapi->id)) {
- case PT_UNSPECIFIED:
- printf(" NONE "); break;
- case PT_NULL:
- printf(" NULL "); break;
- case PT_I2:
- printf(" I2 "); break;
- case PT_LONG:
- printf(" LONG "); break;
- case PT_R4:
- printf(" R4 "); break;
- case PT_DOUBLE:
- printf(" DOUBLE "); break;
- case PT_CURRENCY:
- printf("CURRENCY "); break;
- case PT_APPTIME:
- printf("APP TIME "); break;
- case PT_ERROR:
- printf(" ERROR "); break;
- case PT_BOOLEAN:
- printf(" BOOLEAN "); break;
- case PT_OBJECT:
- printf(" OBJECT "); break;
- case PT_I8:
- printf(" I8 "); break;
- case PT_STRING8:
- printf(" STRING8 "); break;
- case PT_UNICODE:
- printf(" UNICODE "); break;
- case PT_SYSTIME:
- printf("SYS TIME "); break;
- case PT_CLSID:
- printf("OLE GUID "); break;
- case PT_BINARY:
- printf(" BINARY "); break;
- default:
- printf("<%x>", PROP_TYPE(mapi->id)); break;
- }
-
- printf("] Code: [");
- if (mapi->custom == 1) {
- printf("UD:x%04x", PROP_ID(mapi->id));
- } else {
- found = 0;
- for(index=0; index<sizeof(MPList)/sizeof(MAPIPropertyTagList); index++) {
- if ((MPList[index].id == PROP_ID(mapi->id)) && (found == 0)) {
- printf("%s", MPList[index].name);
- found = 1;
- }
- }
- if (found == 0) {
- printf("0x%04x", PROP_ID(mapi->id));
- }
- }
- printf("]\n");
- if (mapi->namedproperty > 0) {
- for(i=0; i<mapi->namedproperty; i++) {
- printf(" Name: %s\n", mapi->propnames[i].data);
- }
- }
- for (i=0;i<mapi->count;i++) {
- mapidata = &(mapi->data[i]);
- if (mapi->count > 1) {
- printf(" [%i/%i] ", i, mapi->count);
- } else {
- printf(" ");
- }
- printf("Size: %i", mapidata->size);
- switch (PROP_TYPE(mapi->id)) {
- case PT_SYSTIME:
- MAPISysTimetoDTR(mapidata->data, &thedate);
- printf(" Value: ");
- TNEFPrintDate(thedate);
- printf("\n");
- break;
- case PT_LONG:
- printf(" Value: %li\n", (long int) *(mapidata->data));
- break;
- case PT_I2:
- printf(" Value: %hi\n", *(mapidata->data));
- break;
- case PT_BOOLEAN:
- if (mapi->data->data[0]!=0) {
- printf(" Value: True\n");
- } else {
- printf(" Value: False\n");
- }
- break;
- case PT_OBJECT:
- printf("\n");
- break;
- case PT_BINARY:
- if(IsCompressedRTF(mapidata)==1) {
- printf(" Detected Compressed RTF.");
- printf("Decompressed text follows\n");
- printf("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
- if((vlTemp.data = DecompressRTF(mapidata, &(vlTemp.size))) != NULL) {
- printf("%s\n", vlTemp.data);
- free(vlTemp.data);
- }
- printf("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
- } else {
- printf(" Value: [");
- for(h=0; h< mapidata->size; h++) {
- if (isprint(mapidata->data[h]))
- printf("%c", mapidata->data[h]);
- else
- printf(".");
-
- }
- printf("]\n");
- }
- break;
- case PT_STRING8:
- printf(" Value: [%s]\n", mapidata->data);
- if (strlen(mapidata->data) != mapidata->size-1) {
- printf("Detected Hidden data: [");
- for(h=0; h< mapidata->size; h++) {
- if (isprint(mapidata->data[h]))
- printf("%c", mapidata->data[h]);
- else
- printf(".");
-
- }
- printf("]\n");
- }
- break;
- default:
- printf(" Value: [%s]\n", mapidata->data);
- }
- }
- }
-}
-
-unsigned char *DecompressRTF(variableLength *p, int *size) {
- unsigned char *dst; // destination for uncompressed bytes
- unsigned char *src;
- unsigned int in;
- unsigned int out;
- variableLength comp_Prebuf;
- ULONG compressedSize, uncompressedSize, magic; // , crc32;
-
- comp_Prebuf.size = strlen(RTF_PREBUF);
- comp_Prebuf.data = calloc(comp_Prebuf.size + 1, 1);
- memcpy(comp_Prebuf.data, RTF_PREBUF, comp_Prebuf.size);
-
- src = p->data;
- in = 0;
-
- compressedSize = (ULONG)SwapDWord(src+in);
- in += 4;
- uncompressedSize = (ULONG)SwapDWord(src+in);
- in += 4;
- magic = SwapDWord(src+in);
- in += 4;
- // crc32 = SwapDWord(src+in);
- in += 4;
-
- // check size excluding the size field itself
- if (compressedSize != p->size - 4) {
- printf(" Size Mismatch: %i != %i\n", compressedSize, p->size-4);
- return NULL;
- }
-
- // process the data
- if (magic == 0x414c454d) {
- // magic number that identifies the stream as a uncompressed stream
- dst = calloc(uncompressedSize,1);
- memcpy(dst, src+4, uncompressedSize);
- return dst;
- } else if (magic == 0x75465a4c) {
- // magic number that identifies the stream as a compressed stream
- int flagCount = 0;
- int flags = 0;
- dst = calloc(comp_Prebuf.size + uncompressedSize,1);
- memcpy(dst, comp_Prebuf.data, comp_Prebuf.size);
- out = comp_Prebuf.size;
- while (out < (comp_Prebuf.size+uncompressedSize)) {
- // each flag byte flags 8 literals/references, 1 per bit
- flags = (flagCount++ % 8 == 0) ? src[in++] : flags >> 1;
- if ((flags & 1) == 1) { // each flag bit is 1 for reference, 0 for literal
- int offset = src[in++];
- int length = src[in++];
- int end;
- offset = (offset << 4) | (length >> 4); // the offset relative to block start
- length = (length & 0xF) + 2; // the number of bytes to copy
- // the decompression buffer is supposed to wrap around back
- // to the beginning when the end is reached. we save the
- // need for such a buffer by pointing straight into the data
- // buffer, and simulating this behaviour by modifying the
- // pointers appropriately.
- offset = (out / 4096) * 4096 + offset;
- if (offset >= out) // take from previous block
- offset -= 4096;
- // note: can't use System.arraycopy, because the referenced
- // bytes can cross through the current out position.
- end = offset + length;
- while (offset < end)
- dst[out++] = dst[offset++];
- } else { // literal
- dst[out++] = src[in++];
- }
- }
- // copy it back without the prebuffered data
- src = dst;
- dst = calloc(uncompressedSize,1);
- memcpy(dst, src + comp_Prebuf.size, uncompressedSize);
- free(src);
- *size = uncompressedSize;
- return dst;
- } else { // unknown magic number
- printf("Unknown compression type (magic number %x)\n", magic );
- return NULL;
- }
-}
diff --git a/src/plugins/tnef_parse/ytnef.h b/src/plugins/tnef_parse/ytnef.h
deleted file mode 100644
index 52fd749..0000000
--- a/src/plugins/tnef_parse/ytnef.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-* Copyright (C) 2004-2014 Colin Leroy and the Claws Mail team
-*
-* Yerase's TNEF Stream Reader Library
-* Copyright (C) 2003 Randall E. Hand
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* You can contact me at randall.hand at gmail.com for questions or assistance
-*/
-#ifndef _TNEF_PROCS_H_
-#define _TNEF_PROCS_H_
-
-#include "tnef-types.h"
-#include "mapi.h"
-#include "mapidefs.h"
-#define STD_ARGLIST (TNEFStruct *TNEF, int id, unsigned char *data, int size)
-DWORD SwapDWord(BYTE *p);
-WORD SwapWord(BYTE *p);
-
-
-void TNEFInitMapi(MAPIProps *p);
-void TNEFInitAttachment(Attachment *p);
-void TNEFInitialize(TNEFStruct *TNEF);
-void TNEFFree(TNEFStruct *TNEF);
-void TNEFFreeAttachment(Attachment *p);
-void TNEFFreeMapiProps(MAPIProps *p);
-int TNEFCheckForSignature(DWORD sig);
-int TNEFParseMemory(BYTE *memory, long size, TNEFStruct *TNEF);
-int TNEFParseFile(char *filename, TNEFStruct *TNEF);
-int TNEFParse(TNEFStruct *TNEF);
-variableLength *MAPIFindUserProp(MAPIProps *p, unsigned int ID);
-variableLength *MAPIFindProperty(MAPIProps *p, unsigned int ID);
-int MAPISysTimetoDTR(BYTE *data, dtr *thedate);
-void MAPIPrint(MAPIProps *p);
-char* to_utf8(int len, char* buf);
-WORD SwapWord(BYTE *p);
-DWORD SwapDWord(BYTE *p);
-DDWORD SwapDDWord(BYTE *p);
-variableLength *MAPIFindUserProp(MAPIProps *p, unsigned int ID);
-variableLength *MAPIFindProperty(MAPIProps *p, unsigned int ID);
-unsigned char * DecompressRTF(variableLength *p, int *size);
-
-/* ------------------------------------- */
-/* TNEF Down-level Attributes/Properties */
-/* ------------------------------------- */
-
-#define atpTriples ((WORD) 0x0000)
-#define atpString ((WORD) 0x0001)
-#define atpText ((WORD) 0x0002)
-#define atpDate ((WORD) 0x0003)
-#define atpShort ((WORD) 0x0004)
-#define atpLong ((WORD) 0x0005)
-#define atpByte ((WORD) 0x0006)
-#define atpWord ((WORD) 0x0007)
-#define atpDword ((WORD) 0x0008)
-#define atpMax ((WORD) 0x0009)
-
-#define LVL_MESSAGE ((BYTE) 0x01)
-#define LVL_ATTACHMENT ((BYTE) 0x02)
-
-#define ATT_ID(_att) ((WORD) ((_att) & 0x0000FFFF))
-#define ATT_TYPE(_att) ((WORD) (((_att) >> 16) & 0x0000FFFF))
-#define ATT(_atp, _id) ((((DWORD) (_atp)) << 16) | ((WORD) (_id)))
-
-#define attNull ATT( 0, 0x0000)
-#define attFrom ATT( atpTriples, 0x8000) /* PR_ORIGINATOR_RETURN_ADDRESS */
-#define attSubject ATT( atpString, 0x8004) /* PR_SUBJECT */
-#define attDateSent ATT( atpDate, 0x8005) /* PR_CLIENT_SUBMIT_TIME */
-#define attDateRecd ATT( atpDate, 0x8006) /* PR_MESSAGE_DELIVERY_TIME */
-#define attMessageStatus ATT( atpByte, 0x8007) /* PR_MESSAGE_FLAGS */
-#define attMessageClass ATT( atpWord, 0x8008) /* PR_MESSAGE_CLASS */
-#define attMessageID ATT( atpString, 0x8009) /* PR_MESSAGE_ID */
-#define attParentID ATT( atpString, 0x800A) /* PR_PARENT_ID */
-#define attConversationID ATT( atpString, 0x800B) /* PR_CONVERSATION_ID */
-#define attBody ATT( atpText, 0x800C) /* PR_BODY */
-#define attPriority ATT( atpShort, 0x800D) /* PR_IMPORTANCE */
-#define attAttachData ATT( atpByte, 0x800F) /* PR_ATTACH_DATA_xxx */
-#define attAttachTitle ATT( atpString, 0x8010) /* PR_ATTACH_FILENAME */
-#define attAttachMetaFile ATT( atpByte, 0x8011) /* PR_ATTACH_RENDERING */
-#define attAttachCreateDate ATT( atpDate, 0x8012) /* PR_CREATION_TIME */
-#define attAttachModifyDate ATT( atpDate, 0x8013) /* PR_LAST_MODIFICATION_TIME */
-#define attDateModified ATT( atpDate, 0x8020) /* PR_LAST_MODIFICATION_TIME */
-#define attAttachTransportFilename ATT( atpByte, 0x9001) /* PR_ATTACH_TRANSPORT_NAME */
-#define attAttachRenddata ATT( atpByte, 0x9002)
-#define attMAPIProps ATT( atpByte, 0x9003)
-#define attRecipTable ATT( atpByte, 0x9004) /* PR_MESSAGE_RECIPIENTS */
-#define attAttachment ATT( atpByte, 0x9005)
-#define attTnefVersion ATT( atpDword, 0x9006)
-#define attOemCodepage ATT( atpByte, 0x9007)
-#define attOriginalMessageClass ATT( atpWord, 0x0006) /* PR_ORIG_MESSAGE_CLASS */
-
-#define attOwner ATT( atpByte, 0x0000) /* PR_RCVD_REPRESENTING_xxx or
- PR_SENT_REPRESENTING_xxx */
-#define attSentFor ATT( atpByte, 0x0001) /* PR_SENT_REPRESENTING_xxx */
-#define attDelegate ATT( atpByte, 0x0002) /* PR_RCVD_REPRESENTING_xxx */
-#define attDateStart ATT( atpDate, 0x0006) /* PR_DATE_START */
-#define attDateEnd ATT( atpDate, 0x0007) /* PR_DATE_END */
-#define attAidOwner ATT( atpLong, 0x0008) /* PR_OWNER_APPT_ID */
-#define attRequestRes ATT( atpShort, 0x0009) /* PR_RESPONSE_REQUESTED */
-
-typedef struct {
- DWORD id;
- char name[40];
- int (*handler) STD_ARGLIST;
-} TNEFHandler;
-
-
-#endif
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list