Tcl Library Source Code

View Ticket
Bounty program for improvements to Tcl and certain Tcl packages.
Ticket UUID: 792796
Title: Let ::mime::parsepart accept a header only with multipart
Type: Patch Version: None
Submitter: ingemarh Created on: 2003-08-21 22:22:40
Subsystem: mime Assigned To:
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2018-08-30 12:06:41
Resolution: Fixed Closed By:
    Closed on:
When calling ::mime::initialize with a header only and the 
header includes a multipart description, ::mime::parsepart 
will return an end-of-file error.
This patch fixes that by counting the lines after the 
header. If no lines are found, no error is thrown.

This is useful when you want to parse a mail header only 
with help of the mime package.

Something to think of:
This only works if the last newline character returned 
from ::pop3::top is removed prior to calling ::mime::
initialize. I thought of patching pop3 too, but thought 
that it's correct that the last line returned also contains 
a newline character.
To help the user so he not needs to think of removing the 
last newline character, maybe ::mime::parsepart should 
count non-blank lines after the header, instead of just 
counting lines.
User Comments: pooryorick added on 2018-08-30 12:03:10:

Fixed in [16a1a9ac6ed750c0]. Headers and body are parsed separately, and only as needed.

andreas_kupries added on 2004-09-30 04:50:56:
Logged In: YES 

Marshall, does this make sense ?

Or should we have a special command just for parsing the
header of a mail or mime part ?

ingemarh added on 2003-08-22 05:22:40:
File Added - 59421: mime.diff