TNEF external expander vs internal

David Hill david.hill at
Wed Mar 20 17:42:52 GMT 2013


                Here is a patch for the bug with 4.84.5-3 !

---      2013-03-20 16:26:35.026843525 +0000
+++     2013-03-20 17:37:45.030484881 +0000
@@ -230,7 +230,7 @@
   # Create the subdir to unpack it into
   #my $unpackdir = "tnef.$$";
   my ($tmpfh, $unpackdir) = tempfile("tnefXXXXXX", TMPDIR => $dir, UNLINK => 0);
-  $dir =~ s,^.*/,,;
+#  $dir =~ s,^.*/,,;
   $unpackdir = $message->MakeNameSafe($unpackdir, $dir);
  unless (mkdir "$dir/$unpackdir", 0777) {
     MailScanner::Log::WarnLog("Trying to unpack %s in message %s, could not create subdirectory %s, failed to unpack TNEF message", $tnefname, $message->{id},

I don't understand why we're getting rid of the full path in this part of MailScanner code!  Did it solve anything for anybody?  It breaks TNEF expansion in my actual configuration !


From: mailscanner-bounces at [mailto:mailscanner-bounces at] On Behalf Of David Hill
Sent: March-20-13 12:35 PM
To: mailscanner at
Subject: RE: TNEF external expander vs internal

Hi guys,

                I may have < found > the problem but I'm not sure :

2013-03-20T16:28:26.021724+00:00 mailserver  MailScanner[11855]: Corrupt TNEF winmail.dat that cannot be analysed in message 4E5601ED1.AD737
2013-03-20T16:30:00.824823+00:00 mailserver MailScanner[12178]: Expanding TNEF archive at /var/spool/MailScanner/incoming/12178/D07311ED1.A0ADA/winmail.dat
2013-03-20T16:30:00.826306+00:00 mailserver MailScanner[12178]: Trying to unpack nwinmail.dat in message D07311ED1.A0ADA, could not create subdirectory D07311ED1.A0ADA//tnef6sGA3q, failed to unpack TNEF message - /var/spool/postfix/hold
2013-03-20T16:30:00.826566+00:00 mailserver MailScanner[12178]: Corrupt TNEF winmail.dat that cannot be analysed in message D07311ED1.A0ADA

I hacked the code a bit and seems like we're in /var/spool/postfix/hold instead of /var/spool/MailScanner/incoming/ !

If that's the case, perhaps the patch will be easily done?


From: David Hill
Sent: March-20-13 12:24 PM
To: 'mailscanner at'
Subject: TNEF external expander vs internal

Hi guys,

                We've upgraded from mailscanner 4.71.10-1 to 4.84.5-3 and we're running into an issue.
Some people said that TNEF external expander was broken, that they applied a patch and/or updated to tnef 1.4.9 but this doesn't
seem to solve our problem.     If we switch to internal, it's definitely solving the issue  but I think this is a hack for something that's broken.

So, just to leave a trace, external is broken, internal works well.

Thank you very much,


-------------- next part --------------
An HTML attachment was scrubbed...

More information about the MailScanner mailing list