Patch for bug in lr_getbody

Francis J. Lacoste francis.lacoste at Contre.COM
Thu Sep 6 22:44:35 CEST 2001


Hello,

There is a bug in the lr_getbody script used by the Lire's responder
which prevent it to decode properly single part MIME message with
a Content-Type of text/plain.

Applying the following patch to lr_getbody fixes the problem.

Index: lr_getbody
===================================================================
RCS file: /cvsroot/logreport/service/all/script/lr_getbody,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- lr_getbody	2001/07/15 19:11:55	1.50
+++ lr_getbody	2001/09/06 20:41:43	1.51
@@ -124,10 +124,14 @@
 # SUBMITTER=`echo $SUBMITTER | sed 's/(/\\\(/g'`
 # SUBMITTER=`echo $SUBMITTER | sed 's/)/\\\)/g'`
 
-# get body
-if grep -i '^Content-Type: ' $file > /dev/null
+# Extract the body from the mail message.
+# Use munpack if it is a MIME message.
+# BUT : We don't use munpack if it is a single part text message
+# since munpack doesn't work with single part text message.
+CONTENT_TYPE=`lr_smtpfield Content-Type < $file || true`
+if test -n "$CONTENT_TYPE" && echo $CONTENT_TYPE | grep -v "text" > /dev/null
 then
-    echo >&2 "$tag info $file is mime message"
+    echo >&2 "$tag info $file is an encoded MIME message"
     cd $TMPDIR
     echo >&2 "$tag info munpacking $file"
     # FIXME: When there are multiple parts, we only take the 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.logreport.org/pipermail/questions/attachments/20010906/b6587f35/attachment.bin 


More information about the Questions mailing list