Hi Tomasz,

Thanks for notifying me about the problems...

I forgot to include in the qmail post that I _only_ tested
the script on M$ Client (MUA's) emails.

I know what you mean. I did a test mail from another MUA
and it shows that it is not using the "Content-Description:".
I will look into this and make some changes on the script.
That's the good thing about posting your script to the Iist.
Someone can find the problems :)

With regards to the "Application". Again this was based on
the M$ Client (MUA) email. When an M$ Client sends an email,
I noticed that it uses e.g. "Content-Description: Virusprg (Application)".
The "Application" here is _not_ the same as the "application" you
can find in the entry "Content-Type: application/octet-stream".
They are totally different. But I will look into this and improve the
script.

I would appreciate however if you can make some suggestions
on how to improve the script.

Thanks,

Noel Mistula


----------
> From: Tomasz Papszun <[EMAIL PROTECTED]>
> To: Noel Mistula <[EMAIL PROTECTED]>
> Subject: Re: Quick & dirty way to filter attachment
> Date: Wednesday, 30 June 1999 17:59
> 
> Hello, Noel
> 
> I'm not writing to the list because my question may be stupid as I
> don't know definitions of the types of mail headers exactly.
> 
> So: *has* the name of the grepped header to be "Content-Description"?
> I grepped some of my mailboxes and found not so many of them but, on the
> other hand, many more headers named "Content-type" (or "Content-Type",
> case doesn't matter).
> 
> And many more attachments are described just by Content-type, not by
> Content-Description. 
> 
> And another remark: I'm not sure if filtering the word "Application"
isn't
> too restrictive. Many quite honest messages (from the qmail list as
well!)
> contain such header:
> 
> Content-Type: multipart/signed; boundary="==_Exmh_598216261P";
micalg=pgp-md5; protocol="application/pgp-signature"
> 
> They are just PGP signed.
> 
> Just my 2 cents...
> -- 
>  Tomasz Papszun   SysAdm @ TP S.A. Lodz, Poland  | And it's only
>  [EMAIL PROTECTED]   http://www.lodz.tpsa.pl/   | ones and zeros.
> 
> 
> 
> On Wed, 30 Jun 1999 at 12:03:36 +1000, Noel Mistula wrote:
> > Hi,
> > 
> > I have a _very_ small script on filtering mails with file attachment.
> > This will work only on single attachment. However, you can extend
> > this script to filter multiple attachments
> > 
> > As I have said this is a quick and dirty way to filter attachments.
> > I'm not a good hack, you can write your own script much much 
> > better than this.
> > 
> > I wrote this because I've been searching the qmail archive and I
couldn't
> > find a single _example_ script for this subject. This posting is
directed
> > to qmail beginners like me. I hope this will be kept in the archive for
> > future reference.
> > 
> > Thanks,
> > 
> > Noel Mistula
> > 
> > ==========================================
> > #!/bin/bash
> > #
> > # qmail     -- checkattach
> > # Author: Noel G. Mistula
> > # Date: 28 June 1999
> > #
> > # This is release under the GNU/GPL.
> > # This is a very crude program. Use at your own risk.
> > # This will delete incoming email with executable,
> > # video and other attachments. 
> > # Just comment/uncomment/add whichever is required.
> > #
> > # I use this in a user's .qmail file
> > # by adding the line
> > # |/usr/local/bin/checkattach
> > # before the ./Maildir/
> > #
> > # Save this script in /usr/local/bin as checkattach
> > #
> > 
> > # Check for executable, application and other attachment.
> > ATTACHTYPE=`grep "Content-Description:" - | gawk {'print $3'} | cut -c
2-`
> > if [ $ATTACHTYPE != "" ]; then
> >     case $ATTACHTYPE in
> >             Application)
> >                     exit 100;;
> >             MS-DOS)
> >                     exit 100;;
> >             Video)
> >                     exit 100;;
> >             Movie)
> >                     exit 100;;
> >             RealAudio)
> >                     exit 100;;
> >             Bitmap)
> >                     exit 100;;
> >             MP3)
> >                     exit 100;;
> >             Wave)
> >                     exit 100;;
> >             *)
> >                     exit 0;;
> >     esac
> > fi
> > exit 0
> > =============================================
> > 

Reply via email to