Thanks Paul...
it is weird...
the documentation says: 
   
   - find_parts()   

      - Used to search the tree for specific MIME parts. An array of matching 
Node objects (pointers into the tree) is returned. The parameters that can be 
passed in are (in order, all scalars):
      - Regexp - Used to match against each part's Content-Type header, 
specifically the type and not the rest of the header.

So the regex applies to only the Content-Type and when i have tested it works 
like the doc says...
Paul, please would it be possible for you to send me the sample you have tried 
with?
Thanks!
----PedroD

      From: Paul Stead <paul.st...@zeninternet.co.uk>
 To: Pedro David Marco <pedrod_ma...@yahoo.com>; 
"users@spamassassin.apache.org" <users@spamassassin.apache.org> 
 Sent: Thursday, August 17, 2017 1:17 AM
 Subject: Re: Attachments with no Content-Type mime header
   
#yiv3786222887 #yiv3786222887 -- _filtered #yiv3786222887 
{font-family:Arial;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv3786222887 
{panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv3786222887 
{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv3786222887 
{font-family:HelveticaNeue;}#yiv3786222887 #yiv3786222887 
p.yiv3786222887MsoNormal, #yiv3786222887 li.yiv3786222887MsoNormal, 
#yiv3786222887 div.yiv3786222887MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv3786222887 a:link, 
#yiv3786222887 span.yiv3786222887MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv3786222887 a:visited, #yiv3786222887 
span.yiv3786222887MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv3786222887 
p.yiv3786222887msonormal, #yiv3786222887 li.yiv3786222887msonormal, 
#yiv3786222887 div.yiv3786222887msonormal 
{margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv3786222887 
p.yiv3786222887msochpdefault, #yiv3786222887 li.yiv3786222887msochpdefault, 
#yiv3786222887 div.yiv3786222887msochpdefault 
{margin-right:0in;margin-left:0in;font-size:12.0pt;}#yiv3786222887 
span.yiv3786222887msohyperlink {}#yiv3786222887 
span.yiv3786222887msohyperlinkfollowed {}#yiv3786222887 
span.yiv3786222887emailstyle17 {}#yiv3786222887 span.yiv3786222887msoins 
{}#yiv3786222887 p.yiv3786222887msonormal1, #yiv3786222887 
li.yiv3786222887msonormal1, #yiv3786222887 div.yiv3786222887msonormal1 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv3786222887 
span.yiv3786222887msohyperlink1 
{color:#0563C1;text-decoration:underline;}#yiv3786222887 
span.yiv3786222887msohyperlinkfollowed1 
{color:#954F72;text-decoration:underline;}#yiv3786222887 
span.yiv3786222887emailstyle171 
{font-family:Calibri;color:windowtext;}#yiv3786222887 span.yiv3786222887msoins1 
{color:teal;text-decoration:underline;}#yiv3786222887 
p.yiv3786222887msochpdefault1, #yiv3786222887 li.yiv3786222887msochpdefault1, 
#yiv3786222887 div.yiv3786222887msochpdefault1 
{margin-right:0in;margin-left:0in;font-size:10.0pt;}#yiv3786222887 
span.yiv3786222887EmailStyle29 
{font-family:Calibri;color:windowtext;}#yiv3786222887 span.yiv3786222887msoIns 
{text-decoration:underline;color:teal;}#yiv3786222887 
.yiv3786222887MsoChpDefault {font-size:10.0pt;} _filtered #yiv3786222887 
{margin:1.0in 1.0in 1.0in 1.0in;}#yiv3786222887 div.yiv3786222887WordSection1 
{}#yiv3786222887 I’ve checked and as in the plugin,      foreach my $part 
($pms->{msg}->find_parts(qr/./, 1)) {    does find each attachment, including 
the ones without Content-Type header – the method below can be used on these 
parts found regardless of lack of Content-Type    Paul    From: Pedro David 
Marco <pedrod_ma...@yahoo.com>
Reply-To: Pedro David Marco <pedrod_ma...@yahoo.com>
Date: Wednesday, 16 August 2017 at 23:49
To: Paul Stead <paul.st...@zeninternet.co.uk>, "users@spamassassin.apache.org" 
<users@spamassassin.apache.org>
Subject: Re: Attachments with no Content-Type mime header    Thanks Paul,     
but your plugin uses find_parts() that turns it pointless if there is no 
Content-Type mime header...         -------- PedroD      >The magic number or 
file signature can be helpful in determining the filetype:   
>https://en.wikipedia.org/wiki/List_of_file_signatures   >I make use of this in 
the OLEMacro plugin: https://github.com/fmbla/spamassassin-olemacro/   >Paul 
Stead    --
Paul Stead
Systems Engineer
Zen Internet


   

Reply via email to