<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18999">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hi All...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I am working on a custom delivery script that is
used after MailScanner has already run. The script uses many of the headers that
MailScanner and Spamassassin insert to determing proper delivery (think
procmail).</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I have the need to determine whether a message has
attachments or if it is just simply text and html body parts without any
attachments.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I can use code like this to do it I
believe:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>if ( $msg->isMultipart ) {<BR>
foreach my $part ( $msg->parts )
{<BR> if ( $part->contentType eq
'text/html' ) {<BR>
# and do a count because more than 1 means 1 is an
attachment<BR>
}<BR> elsif ( $part->contentType eq
'text/plain' ) {<BR>
# and do a count because more than 1 means 1 is an
attachment<BR>
}<BR> else
{<BR> # Means there
are attachments right?<BR>
}<BR> }<BR>}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>But it seems like an unneccessarily heavy approach
since MailScanner has already parsed and analyzed the message prior to this
step. The ideal solution for me would be to have a configuration line
MailScanner.conf that would allow me to turn on "AddAttachmentsCheckToHeader" or
something like that and MailScanner could add a header like:
X-MailScanner-HasAttachments: Yes or something similar. I don't think this would
take much to do and I don't think it would require much (if any) additional
overhead for MailScanners processing since it already has the message
parsed.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Something like this would be very useful to a
number of applications that custom deliver mail based on different attributes
that they need to parse from the header so I don't think this is just something
that would benefit my use-case.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV>
<DIV><FONT size=2 face=Arial>Any thoughts would be greatly appreciated and if
there is already a way to do this that I am just missing... please let me know.
</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Thanks,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Drew</FONT></DIV></DIV></BODY></HTML>