Don Armstrong <d...@debian.org> writes: > 1) Returning large attachments in get_mail_log() would be fairly > surprising to existing users of that interface; it should really return > some kind of record of the MIME structure which could then be retrieved > using a second interface > > 2) MIME messages are much more complicated than just a list of > attachments; there could be additional messages with more attachments > within them
The most simple way would be to handle any attachment like a message. 'header' would be the two lines 'Content-Type' and 'Content-Transfer-Encoding'. Every attachment would get a unique message number, like the messages themselves. 'get_bug_log' shall support the second argument $msg_num (which is still could be optional), in order to retrieve the bodies of attachments. We would have then --8<---------------cut here---------------start------------->8--- =head2 get_bug_log my $bug_log = get_bug_log($bug); my $bug_log = get_bug_log($bug,$msg_num); Returns a parsed set of the bug log; this is an array of hashes with the following [{header => '...', body => '...', attachments => [11, 15, 20], msg_num => 5, }, {header => '...', body => '...', attachments => [], msg_num => 8, }, ] =cut --8<---------------cut here---------------end--------------->8--- Alternatively, we could have a structure in the attachments with just 'header' and 'msg_num', like --8<---------------cut here---------------start------------->8--- [{header => '...', body => '...', attachments => [{header => '...', msg_num => 11, }, header => '...', msg_num => 15, }, {header => '...', msg_num => 20, }, ], msg_num => 5, }, {header => '...', body => '...', attachments => [], msg_num => 8, }, ] --8<---------------cut here---------------end--------------->8--- What do you think? Best regards, Michael.