Bug 128075 - mail/mutt problem with malformed multipart mail
Summary: mail/mutt problem with malformed multipart mail
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Martin Wilke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-13 21:50 UTC by Guy Brand
Modified: 2008-10-19 17:30 UTC (History)
0 users

See Also:


Attachments
file.diff (983 bytes, patch)
2008-10-13 21:50 UTC, Guy Brand
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guy Brand 2008-10-13 21:50:01 UTC
mutt-devel has a bug with some malformed multipart message. The symptom is simple: when you have such a mail you just cannot open it and mutt shows a "Impossible to copy" message. I

Fix: The defect was reported upstream and fixed in July by Brendan Cully. The fix is available in mutt's mercurial repository (http://dev.mutt.org/hg/mutt) as changeset 5421:f5fe657f0633. To fix the issue in FreeBSD port apply the attached patch to mutt-1.5.18.tar.gz sources.

Patch attached with submission follows:
How-To-Repeat: Install mutt-devel from the ports and hit a malformed message...
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2008-10-13 22:01:52 UTC
Maintainer of mail/mutt,

Please note that PR ports/128075 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/128075

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2008-10-13 22:01:56 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Udo.Schweigert 2008-10-16 10:09:16 UTC
Please apply the following patch.
Committer: cvs add files/patch-handler.c 

Message: Fix handling of malformed multipart messages. The patch has been
taken from mutt's source code repository.

Regards

Udo

diff -ru  /usr/ports/mail/mutt-devel/files/patch-handler.c ./files/patch-handler.c
--- /usr/ports/mail/mutt-devel/files/patch-handler.c	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-handler.c	2008-10-16 10:59:30.000000000 +0200
@@ -0,0 +1,32 @@
+--- handler.c.orig	2008-01-30 05:26:50.000000000 +0100
++++ handler.c	2008-10-16 10:56:40.000000000 +0200
+@@ -1199,11 +1199,12 @@
+     
+     if (rc)
+     {
++      mutt_error ("One or more parts of this message could not be displayed");
+       dprint (1, (debugfile, "Failed on attachment #%d, type %s/%s.\n", count, TYPE(p), NONULL (p->subtype)));
+     }
+     
+-    if (rc || ((s->flags & M_REPLYING)
+-               && (option (OPTINCLUDEONLYFIRST)) && (s->flags & M_FIRSTDONE)))
++    if ((s->flags & M_REPLYING)
++        && (option (OPTINCLUDEONLYFIRST)) && (s->flags & M_FIRSTDONE))
+       break;
+   }
+ 
+@@ -1564,6 +1565,14 @@
+ 
+     if (!handler)
+       handler = multipart_handler;
++    
++    if (b->encoding != ENC7BIT && b->encoding != ENC8BIT
++        && b->encoding != ENCBINARY)
++    {
++      dprint (1, (debugfile, "Bad encoding type %d for multipart entity, "
++                  "assuming 7 bit\n", b->encoding));
++      b->encoding = ENC7BIT;
++    }
+   }
+   else if (WithCrypto && b->type == TYPEAPPLICATION)
+   {
Comment 4 Martin Wilke freebsd_committer freebsd_triage 2008-10-17 20:41:31 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

I'll take it.
Comment 5 Martin Wilke freebsd_committer freebsd_triage 2008-10-19 17:20:44 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!
Comment 6 dfilter service freebsd_committer freebsd_triage 2008-10-19 17:20:47 UTC
miwi        2008-10-19 16:20:33 UTC

  FreeBSD ports repository

  Modified files:
    mail/mutt-devel      Makefile 
  Added files:
    mail/mutt-devel/files patch-handler.c 
  Log:
  - Fix handling of malformed multipart messages
  - Bump PORTREVISION
  
  PR:             128075
  Submitted by:   Udo Schweigert (maintainer)
  Reported by:    Guy Brand <gb@isis.u-strasbg.fr>
  Obtained from:  The patch has been taken from mutt's source code repository.
  
  Revision  Changes    Path
  1.297     +1 -1      ports/mail/mutt-devel/Makefile
  1.1       +32 -0     ports/mail/mutt-devel/files/patch-handler.c (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"