[Pymilter] Emulating another MimeDefang function

Stuart D. Gathman stuart at bmsi.com
Mon Nov 21 15:31:37 EST 2011


On Mon, 21 Nov 2011, Larry G. Wapnitsky wrote:

> OK...still puzzling through the defang stuff.  I'm trying to trace through
> and still don't see what I'm looking for.

The getnames() method extracts the attachment names zipnames() extracts
zip filename.  For defang purposes, there is no standard for extracting names.
It all depends on bugs in LookOut.  Lookout thinks *any* Content-Type
attribute value that looks like a filename might be a file name, and
attempts to execute the attachment it it has an executable extension.

> As for the part about misreporting the multiparts, I'm attaching a file to a
> message in Thunderbird and sending it through my mail server.  I have the
> output logged for diagnostics as follows:

You do not collect the email headers via the header callback.

Here is a very simple one from milter-template.py:

   @Milter.noreply
   def header(self, name, hval):
     self.fp.write("%s: %s\n" % (name,hval))     # add header to buffer
     return Milter.CONTINUE

   @Milter.noreply
   def eoh(self):
     self.fp.write("\n")                         # terminate headers
     return Milter.CONTINUE

--
 	      Stuart D. Gathman <stuart at bmsi.com>
     Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.




More information about the Pymilter mailing list