Roundup Tracker - Issues

Issue 841241

classification
work harder to find text/plain
Type: Severity: normal
Components: Mail interface Versions:
process
Status: closed fixed
:
: richard : jlgijsbers, richard
Priority: normal :

Created on 2003-11-13 06:41 by richard, last changed 2004-01-17 13:50 by jlgijsbers.

Files
File name Uploaded Description Edit Remove
mailgw-Message.diff jlgijsbers, 2003-11-28 23:54
Messages
msg1050 Author: [hidden] (richard) Date: 2003-11-13 06:41
The mailgw needs to *recursively* (depth-first) search for a 
text/plain part in incoming emails. A GPG-signed message with an 
attachment looks like: 
 
multipart/signed 
  multipart/mixed 
    text/plain 
    application/x-pdf 
  application/pgp-signature 
 
which is not handled at all :) 
 
 
It'd be so cool to have validation of the signature too, but that's 
for another day :) 
msg1051 Author: [hidden] (jlgijsbers) Date: 2003-11-28 23:54
Logged In: YES 
user_id=469548

I've implemented this while refactoring the code extensively:

- I've extracted the extract_content method from handle_message.
- I've moved the get_part_data_decoded and extract_content
methods to the Message class.
- I've renamed the get_part_data_decoded to getbody and
getPart to getpart to bring them in line with the rest of
rfc822 and mimetools.
- I've extracted the getparts, getname and as_attachment
methods from extract_content.

I've also added a bunch of tests to test_multipart and made
up a new format easily describing messages without having to
type them out all the time.

A problem with my approach is that it handles all
non-text/plain parts as attachments, thus we need to ignore
some content types (e.g. application/pgp-signature). I can't
think of any other examples, but I would like to know about
them.

I'm attaching this implementation as a (rather extensive)
patch instead of checking it in, because it breaks backward
compatibility a bit (renaming getPart and moving
get_part_data_decoded).

Also, I'm losing my internet connection on my workstation
for an indefinite time because of moving. As such, I can't
take responsibility for maintaining this code, though I'm
confident it's correct.
msg1052 Author: [hidden] (jlgijsbers) Date: 2004-01-17 13:50
Logged In: YES 
user_id=469548

I've got an internet connection again, twice a week at
least, so I've checked the patch in.
History
Date User Action Args
2003-11-13 06:41:25richardcreate