Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 60367 - TMDA requires a patch to correctly handle multi-part messages
Summary: TMDA requires a patch to correctly handle multi-part messages
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-14 14:48 UTC by Chet McNeill
Modified: 2004-09-26 16:26 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chet McNeill 2004-08-14 14:48:41 UTC
The patch applies to 1.0.   I have downloaded the 1.3 version and it still does not seem to address this issue (the patch will still apply to that version when an ebuild for it becomes available).  The patch was created by Alexandre Ratti.

Without it multi-part messages incorrectly marked as text cause non-delivery and an error by TMDA. I have a large debug file from TMDA to show that it happens more often that you'd think.

--- tmda-1.0/TMDA/pythonlib/email/Generator.py  2003-07-30 13:32:54.000000000 -0600
+++ /usr/lib/python2.3/site-packages/TMDA/pythonlib/email/Generator.py  2004-08-14 15:32:21.000000000 -0600
@@ -197,7 +197,14 @@
         if cset is not None:
             payload = cset.body_encode(payload)
         if not _isstring(payload):
-            raise TypeError, 'string payload expected: %s' % type(payload)
+                   # AGW start
+            # Changed to handle malformed messages with a text base
+                   # type and a multipart content
+                   if type(payload) == type([]) and msg.is_multipart():
+                       return self._handle_multipart(msg)
+                   else:
+                raise TypeError, 'string payload expected: %s' % type(payload)
+                   # AGW end
         if self._mangle_from_:
             payload = fcre.sub('>From ', payload)
         self._fp.write(payload)
Comment 1 Andrej Kacian (RETIRED) gentoo-dev 2004-09-22 01:59:10 UTC
Patch used in 1.0.3-r1, now in CVS portage. Should be hitting mirrors within few hours.

Thanks for the patch! Next thing I'll look at TMDA 1.3.
Comment 2 Blu3 2004-09-26 16:20:36 UTC
# emerge -u tmda
Calculating dependencies                                      ...done!
>>> emerge (1 of 1) mail-filter/tmda-1.0.3-r1 to /
>>> md5 src_uri ;-) tmda-1.0.3.tgz
>>> Checking tmda-1.0.3.tgz's mtime...
>>> /usr/portage/mail-filter/tmda/tmda-1.0.3-r1.ebuild has been updated; recreating WORKDIR...
>>> Unpacking source...
>>> Unpacking tmda-1.0.3.tgz to /var/tmp/portage/tmda-1.0.3-r1/work
>>> Source unpacked.
 * Applying tmda-1.0-multipart-handling.patch...                                                                     [ ok ]
Sorry: IndentationError: ('unindent does not match any outer indentation level', ('./TMDA/pythonlib/email/Generator.py', 206, 79, "                raise TypeError, 'string payload expected: %s' % type(payload)\n"))Compiling ./TMDA/Address.py ...

[...]

Please re-open and fix the patch
Comment 3 Andrej Kacian (RETIRED) gentoo-dev 2004-09-26 16:26:38 UTC
The patch gets applied correctly, despite the message. The output looks like it comes from portage itself.