CENTOS 7, perl 5.
I'm having problems with MIME::Parser extracting (correctly) attachments but incorrectly naming them.
An attachment defined as :
name="Copy of 1501733944381-20170803 Dataload.xlsx"
Content-Description: Copy of 1501733944381-20170803 Dataload.xlsx
filename="Copy of 1501733944381-20170803 Dataload.xlsx";
size=23847; creation-date="Mon, 09 Oct 2017 12:39:28 GMT";
modification-date="Mon, 09 Oct 2017 12:38:40 GMT"
... and code defined as...
my $emailfile = basename("$email");
my $tmpdir = "/tmp/$emailfile";
my $parser = MIME::Parser->new();
my $message = $parser->parse_open("$email");
... and variable $email defined as a full path and filename, I get a file created in /tmp/$emailfilename as
Copy of 150173.xls
Two things. The name is wrong and the suffix is wrong. I can live with the suffix being wrong but it does point to possibly the problem being with the content-type being something MIME::Parser doesn't fully recognise. Anyone come across anything like this? Anyone solve it?