[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[approved] RE: Problems with mha-decode "losing" attachments



There is an error in mhmimetypes.pl, sub get_cnt.  I don't have the original
code anymore, but this fixed the same problem for me:


sub get_cnt {
    my $ctype 	= shift;		# content-type
    my $dir 	= shift || $CURDIR;	# directory
    my $inext 	= shift;		# passed in extension (optional)

    my(@files)  = ();
    my $ext 	= $inext || (get_mime_ext($ctype))[0];
    my $pre 	= $ext;
    my $cnt	= -1;
    local(*DIR);

    substr($pre, 3) = "" if length($pre) > 3;

    if (!opendir(DIR, $dir)) {
	warn qq/Warning: Unable to open "$dir": $!\n/;
    } else {
	@files = sort file_numeric grep(/^$pre\d+\.$ext$/i, readdir(DIR));
	closedir(DIR);
	if (@files) {
	    ($cnt) = $files[$#files] =~ /(\d+)/;
	}
    }

# 822 correction SAJ Aug 02
    $cnt = substr($cnt, -5);

    ++$cnt;
    (sprintf("%05d", $cnt), $pre, $ext);
}


Sorry Earl, I should have sent this to you.




-----Original Message-----
From: Earl Hood [mailto:earl@earlhood.com]
Sent: Tuesday, September 24, 2002 10:06 AM
To: mhonarc-users@mhonarc.org
Subject: Re: Problems with mha-decode "losing" attachments


On September 24, 2002 at 15:57, Simon Lascelles wrote:

> I'm using it to transfer multiple messages from MS-Outlook... I 
> highlight a number of messages in Outlook and forward them to
> a unix mail account.  I then run someting like:
> 
> mha-decode -dcd-digest -single -outdir dirname /var/spool/mail/username
-------------------------^^^^^^^
You are processing a mailbox file, not a single message.

> Sadly, I seem to be losing some messages!  For instance I can batch 
> together 4 messages, forward them and check the Unix /var/spool/mail 
> file and all 4 attachments are in the file, but when I run mha-decode on 
> them I only get three 822.*\.822 files (and the "normal" text file).
> 
> Has anyone else seen this?  Am I doing something dumb?

Without seeing the actual input data, I cannot tell what may be
the problem.  You can zip up a some sample data that is apparently
exhibiting the problem and mail it to me personally to look at.

--ewh

---------------------------------------------------------------------
To sign-off this list, send email to majordomo@mhonarc.org with the
message text UNSUBSCRIBE MHONARC-USERS

---------------------------------------------------------------------
To sign-off this list, send email to majordomo@mhonarc.org with the
message text UNSUBSCRIBE MHONARC-USERS


[Index of Archives]     [Bugtraq]     [Yosemite News]     [Mhonarc Home]