[Mimedefang] Code to remove winmail.dat files and replace them with the attachments.

Matthew Schumacher matt.s at aptalaska.net
Tue Jul 19 15:36:36 EDT 2005


hans hm04 wrote:
> 
> hi Thomas 
> 
> did you find a solution in the meantime ? 
> i noticed, not all winmail.dat-attachements do have 
> real data with included files. 
> some of them have only a pointer to a file of an external filesystem.
> therefore nothing couldn't be extracted. 
> 
> i am also interesting of automtic converting winmail.dat to 
> "normal" attachments - as we don't use microsoft 
> so i asked for a solution in 02/2004 - but no satisfied answers.
> in the meantime there is a patch availabel - as i see.
> 
> are there success-stories with this patch too ? 
> 
> best regards 
> hans 
> 

Whoa, someone is talking about my code and I'm not even paying attention....

I have that code in prod and it works fine, but you must compile and
install the ytnef binary.

If you look at the code:

@new_files = `/usr/local/bin/ytnef -f Work $path`;

foreach my $file ( @new_files ){
  chomp( $file );
  push( @tnef_files, $file );
  md_syslog( 'info', "Found file $file in winmail.dat attachment" );
}

It uses ytnef to extract the files, if there are files extracted they
are later attached, if not, the winmail.dat file is deleted and nothing
is attached.

Hope that helps,
schu



More information about the MIMEDefang mailing list