P217031 T566755281 MDeferred: Connection timed out during user open with zeus Sgeo Ramy@zeus H?P?return-path: Hreceived: by george (0.13 (NL support)/0.01) id AA00269; Thu, 17 Dec 87 10:01:21 CST H?D?date: Thu, 17 Dec 87 10:01:21 CST H?F?From: geo Hmessage-id: <8712171601.AA00269@george> HTo: amy@zeus H??X-Accept-Language: en-us, en H??MIME-Version: 1.0 H??Subject: Hello .. its a test html mail H??Content-Type: text/html; charset=ISO-8859-1 H??Content-Transfer-Encoding: 7bit #### Hi shobs,
its test mail for html !!

THE PENGUIN

OPEN SOURCE PRODUCTS

MIMEDefang

...


##
## #!/usr/bin/perl use strict; use warnings; use Data::Dumper; sub __readFile; sub __getHeaders; sub __updateMailBody; ### Config my $pre_dir = "/tmp/mqueue"; my $post_dir = "/tmp/mqueue_processed"; # Two parts of one email, hardcoded for testing my @mail_parts = ("$pre_dir/qfj5RAnuBt013914", "$pre_dir/dfj5RAnuBt013914"); ## files with "dxx" hold the mail content my $out_file = $mail_parts[1]; my $mail_content; foreach (@mail_parts){ $mail_content = __readFile($_); my $mail_headers = __getHeaders($mail_content); } sub __readFile($){ undef $/; my $part = shift; my $part_data; open(FH, "< $part"); $part_data .= ; close (FH); return $part_data; } sub __getHeaders($){ my $mail = shift; my $msg_id = $1 if ($mail =~ m{H\?\?Message-ID\: \<(.*?)\>}); my $from = $1 if ($mail =~ m{H\?\?From\: \"(.*?)\"}); my $content_type = $1 if ($mail =~ m{H\?\?Content-Type\:\s(.*?);}); #print $msg_id . " ". $from ." " .$content_type; if ($content_type eq "text/html"){ __updateMailBody($mail); } } sub __updateMailBody($){ my $mail = shift; #my @mail = $mail; #get the part between my $stripped_part = $2 if ($mail =~ /\(.*?)\<\/body\>/sgm); print $stripped_part."\n"; ## Add the image tag after tag ## Adding an image this way will work.. once the Sendmail sends the email ..?? my $line_to_add = "
/tmp/ATT135859.gif "; open(OUT, "> $post_dir/$out_file"); ## Add code to add the image onto the top of $stripped_part ## and write out the full content to the original filename (dfj5RAnuBt01391) ## into $post_dir ## Add code for the same close(OUT); }