changeset 236:093e0e9248bb stable-0-6-43

cleanup rfc822 embedded message code
author Carl Byington <carl@five-ten-sg.com>
date Sat, 12 Sep 2009 11:44:08 -0700
parents 9d6bb722d0fe
children 568b9ef02a56
files ChangeLog NEWS libpst.spec.in regression/regression-tests.bash src/readpst.c xml/libpst.in
diffstat 6 files changed, 37 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Sep 11 12:59:24 2009 -0700
+++ b/ChangeLog	Sat Sep 12 11:44:08 2009 -0700
@@ -1,4 +1,4 @@
-LibPST 0.6.43 (2009-09-11)
+LibPST 0.6.43 (2009-09-12)
 ===============================
     * patches from Justin Greer.
 	add code pages 1200 and 1201 to the list for iconv
--- a/NEWS	Fri Sep 11 12:59:24 2009 -0700
+++ b/NEWS	Sat Sep 12 11:44:08 2009 -0700
@@ -1,4 +1,4 @@
-0.6.43  2009-09-10 patches from Justin Greer, Chris White, Roberto Polli; better rfc822 embedded message decoding
+0.6.43  2009-09-12 patches from Justin Greer, Chris White, Roberto Polli; better rfc822 embedded message decoding
 0.6.42  2009-09-03 patch from Fridrich Strba to build with DJGPP DOS cross-compiler
 0.6.41  2009-06-23 fix ax_python detection - should not use locate command
 0.6.40  2009-06-23 fedora 11 has python2.6, remove pdf version of the man pages
--- a/libpst.spec.in	Fri Sep 11 12:59:24 2009 -0700
+++ b/libpst.spec.in	Sat Sep 12 11:44:08 2009 -0700
@@ -146,13 +146,14 @@
 
 
 %changelog
-* Thu Sep 10 2009 Carl Byington <carl@five-ten-sg.com> - 0.6.43-1
+* Thu Sep 12 2009 Carl Byington <carl@five-ten-sg.com> - 0.6.43-1
 - decode more of the pst format, some minor bug fixes
 - add support for code pages 1200 and 1201.
 - add readpst -t option to select output item types, which can
   now be used to process folders containing mixed item types.
 - fix segfault with embedded appointments
 - add readpst -u option for Thunderbird mode .size and .type files
+- better detection of embedded rfc822 message attachments
 
 * Thu Sep 03 2009 Carl Byington <carl@five-ten-sg.com> - 0.6.42-1
 - patch from Fridrich Strba to build with DJGPP DOS cross-compiler.
--- a/regression/regression-tests.bash	Fri Sep 11 12:59:24 2009 -0700
+++ b/regression/regression-tests.bash	Sat Sep 12 11:44:08 2009 -0700
@@ -22,9 +22,12 @@
     fn="$2"
     echo $fn
     ba=$(basename "$fn" .pst)
+    size=$(stat -c %s $fn)
     rm -rf output$n
-    mkdir output$n
-    $val ../src/pst2dii -f /usr/share/fonts/bitstream-vera/VeraMono.ttf -B "bates-" -o output$n -O $ba.mydii -d $fn.log $fn >$fn.dii.err 2>&1
+    if [ -z "$val" ] || [ $size -lt 10000000 ]; then
+        mkdir output$n
+        $val ../src/pst2dii -f /usr/share/fonts/bitstream-vera/VeraMono.ttf -B "bates-" -o output$n -O $ba.mydii -d $fn.log $fn >$fn.dii.err 2>&1
+    fi
 }
 
 
@@ -34,9 +37,12 @@
     fn="$2"
     echo $fn
     ba=$(basename "$fn" .pst)
+    size=$(stat -c %s $fn)
     rm -rf output$n
-    mkdir output$n
-    $val ../src/pst2ldif -d $ba.ldif.log -b 'o=ams-cc.com, c=US' -c 'inetOrgPerson' $fn >$ba.ldif.err 2>&1
+    if [ -z "$val" ] || [ $size -lt 10000000 ]; then
+        mkdir output$n
+        $val ../src/pst2ldif -d $ba.ldif.log -b 'o=ams-cc.com, c=US' -c 'inetOrgPerson' $fn >$ba.ldif.err 2>&1
+    fi
 }
 
 
@@ -46,18 +52,20 @@
     fn="$2"
     echo $fn
     ba=$(basename "$fn" .pst)
+    size=$(stat -c %s $fn)
     jobs=""
-    [ -n "$val" ]              && jobs="-j 0"
-    [ "$regression" == "yes" ] && jobs="-j 0"
+    [ -n "$val" ] && jobs="-j 0"
     rm -rf output$n
-    mkdir output$n
-    if [ "$regression" == "yes" ]; then
-        $val ../src/readpst $jobs -te -r -D -cv -o output$n $fn >$ba.err 2>&1
-    else
-        #val ../src/readpst $jobs -r -D -cv -o output$n            $fn
-        $val ../src/readpst $jobs -r -D -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
-        #$val ../src/readpst $jobs -r -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
-        #../src/getidblock -p $fn 0 >$ba.fulldump
+    if [ -z "$val" ] || [ $size -lt 10000000 ]; then
+        mkdir output$n
+        if [ "$regression" == "yes" ]; then
+            $val ../src/readpst $jobs -te -r -cv -o output$n $fn >$ba.err 2>&1
+        else
+            #val ../src/readpst $jobs -r -D -cv -o output$n            $fn
+            $val ../src/readpst $jobs -te -r -D -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
+            #$val ../src/readpst $jobs -r -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
+            #../src/getidblock -p $fn 0 >$ba.fulldump
+        fi
     fi
 }
 
@@ -70,14 +78,15 @@
 
 rm -rf output* *.err *.log
 
+v="valgrind --leak-check=full"
+val=""
+
 func="dopst"
 [ "$1" == "pst"  ] && func="dopst"
+[ "$1" == "pstv" ] && func="dopst" && val=$v
 [ "$1" == "ldif" ] && func="doldif"
 [ "$1" == "dii"  ] && func="dodii"
 
-val="valgrind --leak-check=full"
-val=""
-
 regression=""
 [ "$2" == "reg" ] && regression="yes"
 [ "$regression" == "yes" ] && val=""
--- a/src/readpst.c	Fri Sep 11 12:59:24 2009 -0700
+++ b/src/readpst.c	Sat Sep 12 11:44:08 2009 -0700
@@ -1575,18 +1575,13 @@
             pst_convert_utf8_null(item, &attach->mimetype);
             DEBUG_INFO(("Attempting Attachment encoding\n"));
             if (attach->method == PST_ATTACH_EMBEDDED) {
-                DEBUG_INFO(("seem to have special embedded message attachment\n"));
-                char *m = NULL;
+                DEBUG_INFO(("have an embedded rfc822 message attachment\n"));
                 if (attach->mimetype.str) {
-                    DEBUG_INFO(("already has a mime-type of %s\n", attach->mimetype.str));
+                    DEBUG_INFO(("which already has a mime-type of %s\n", attach->mimetype.str));
                     free(attach->mimetype.str);
                 }
                 attach->mimetype.str = strdup(RFC822);
                 attach->mimetype.is_utf8 = 1;
-                write_embedded_message(f_output, attach, boundary, pst, &m);
-            }
-            else if (!attach->data.data && attach->mimetype.str && !strcmp(attach->mimetype.str, RFC822)) {
-                DEBUG_INFO(("seem to have embedded message attachment\n"));
                 find_rfc822_headers(extra_mime_headers);
                 write_embedded_message(f_output, attach, boundary, pst, extra_mime_headers);
             }
--- a/xml/libpst.in	Fri Sep 11 12:59:24 2009 -0700
+++ b/xml/libpst.in	Sat Sep 12 11:44:08 2009 -0700
@@ -35,7 +35,7 @@
 
     <refentry id="readpst.1">
         <refentryinfo>
-            <date>2009-06-06</date>
+            <date>2009-09-12</date>
         </refentryinfo>
 
         <refmeta>
@@ -245,7 +245,7 @@
 
     <refentry id="lspst.1">
         <refentryinfo>
-            <date>2009-06-06</date>
+            <date>2009-09-12</date>
         </refentryinfo>
 
         <refmeta>
@@ -340,7 +340,7 @@
 
     <refentry id="pst2ldif.1">
         <refentryinfo>
-            <date>2009-06-06</date>
+            <date>2009-09-12</date>
         </refentryinfo>
 
         <refmeta>
@@ -508,7 +508,7 @@
 
     <refentry id="pst2dii.1">
         <refentryinfo>
-            <date>2009-06-06</date>
+            <date>2009-09-12</date>
         </refentryinfo>
 
         <refmeta>
@@ -641,7 +641,7 @@
 
     <refentry id="pst.5">
         <refentryinfo>
-            <date>2009-06-06</date>
+            <date>2009-09-12</date>
         </refentryinfo>
 
         <refmeta>