Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Filtering mail attachments

by andreychek (Parson)
on Aug 21, 2002 at 01:19 UTC ( #191634=note: print w/replies, xml ) Need Help??

in reply to Filtering mail attachments

Using Mime::Decoder as tachyon pointed out would work well. However, there are some existing applications which already do what you are looking for -- some are even written in Perl! :-)

There are a bunch of such programs on Freshmeat. Below are a few of them, all of which are written in Perl:

  • batemail
    Used from procmail, can take a list of extension types, and removes matching attachments from incoming emails.

  • MIMEDefang
    Working with Sendmail's new Milter API, MIMEDefang can delete or alter attachments based on a config file, amongst a load of other message altering features.

  • the Anomy mail sanitizer
    Anomy is a bit more encompasing of program than you had asked for, but I'll mention it nonetheless. It handles removing/renaming attachments, which includes arbitrarily long RFC822 attachments. It truncates long MIME headers, and can disable Javascript and other potentially dangerous HTML.

  • Email Security Through Procmail
    Providing much of the functionality that the Anomy mail sanitizer does, this program also covers a lot of ground in the amount of things it protects users from.

    Each of the last two email scanners will be capable of removing uuencoded attachments. However, if you're still looking to build your own, you could use MIME:;Decoder::UU to help out with that.

    Good luck!

    Lucy: "What happens if you practice the piano for 20 years and then end up not being rich and famous?"
    Schroeder: "The joy is in the playing."
  • Log In?

    What's my password?
    Create A New User
    Node Status?
    node history
    Node Type: note [id://191634]
    [LanX]: hey I was told yesterday that "Alma Ata" means father of the apple (ex capital of Kazakhstan) ... so alma is Turkish
    [Discipulus]: good point: alms ~charity I made a varronian etymology, sorry, from Alma ~soul
    [erix]: alms, aalmoes, almosen from greek eleēmosúnē
    [Discipulus]: Almosen is Elemosina in Eatalian
    [erix]: yeah, you mediteraaneans are one big family :)
    [Discipulus]: greece had to copyrigth etymologies to fill the debt..
    [erix]: good no-nonsense american approach to these soft european practices: "Upon entering the Almshouses in Connecticut, patients were whipped up to 10 times"
    Discipulus should have..
    [erix]: the almshouse generally seems to have become an anglosaxon relic :P
    [Discipulus]: just to be sure was not for a free lunch.. sbaaam!

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (10)
    As of 2017-11-23 20:24 GMT
    Find Nodes?
      Voting Booth?
      In order to be able to say "I know Perl", you must have:

      Results (338 votes). Check out past polls.