[Mimedefang] (newbie) attachment authentication

josh josh at tkos.co.il
Mon Feb 25 10:34:16 EST 2002


On Mon, 25 Feb 2002, David F. Skoll wrote:

>
> > 	I want to make sure that an attachment is really what it claims
> > to be i.e. a .doc file is really a .doc and not an .exe.
>
> That's probably impossible in general, but for many cases, it will work.

Can you please explain what you mean by " for many cases, it will work"?
Do you mean running unix command file on the attachments will work to
tell me what kind of file they really are?

>
> > Do I need to
> > run the unix command "file" to do this
>
> Yes, or some equivalent like opening $entity->bodyhandle->path yourself
> and examining the file contents.  But it's best to do something like this:
>
> $path = $entity->bodyhandle->path;
> $UnixFileSays = `file $path`;
> # Now use $UnixFileSays...
>
> Be aware that these tests are likely to be expensive, because they fork() and
> exec() for each attachment.

Is there another method to verify attachment types that is less
expensive that you could suggest?

>
> Regards,
>
> David.
>
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>

-- 
  - josh

  94 F8 9F 3E 9A DB 6E FC  F8 17 F1 B4 C7 51 CB AA   ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - josh at tkos.co.il - tel: +972.58.520.636, http://www.tkos.co.il




More information about the MIMEDefang mailing list