Filter for mail attachment size ? (to be used from Procmail or similar)

Discussion in 'Perl Misc' started by Horst Lemminger, Dec 20, 2011.

  1. I have been looking for a long time for a filter on attachment size in
    emails.

    At the mailserver, which is running Postfix and Procmail, there
    already is a an auto-reply filter in Perl that checks a DB for status,
    so filtering with Perl in general works.

    Here is what I would like to do:

    * check mail if there is any attached files
    * if attachment is above (xxx) bytes - this can be read from a
    database per user - remove the attachment and send a reply back to
    sender that they need to use an upload service.
    * then forward rest of mail (main body) to recipient

    I have studied the docs on Mail::Simple etc, but have not been able to
    understand how.

    So, anyone with a completed script or points on how to get started on
    this ?

    Ultimate goal is to get rid of people that mail 10Mb+ screenshots to
    explain a simple thing.
    PS: if anyone has a pointer on how to do this in Procmail or other
    scripting languages, fine with me..

    Thanks
    Horst Lemminger, Dec 20, 2011
    #1
    1. Advertising

  2. Re: Filter for mail attachment size ? (to be used from Procmail orsimilar)

    Me three, four, five :)-O

    I am more interested from the perspective of doing really weird
    stuff in developing countries, which involve cutting off of
    attachments, batching and gzipping, and perhaps even uucp again :)-O

    Of course at the same time one would need to check for the message
    size so that one catches uu/mime-encoded stuff in the text, which
    doesn't gzip nice and as such could just be bounced altogether...


    el

    on 2011-12-20 11:38 Horst Lemminger said the following:
    > I have been looking for a long time for a filter on attachment
    > size in emails.
    >
    > At the mailserver, which is running Postfix and Procmail, there
    > already is a an auto-reply filter in Perl that checks a DB for
    > status, so filtering with Perl in general works.
    >
    > Here is what I would like to do:
    >
    > * check mail if there is any attached files
    > * if attachment is above (xxx) bytes - this can be read from a
    > database per user - remove the attachment and send a reply back to
    > sender that they need to use an upload service.
    > * then forward rest of mail (main body) to recipient
    >
    > I have studied the docs on Mail::Simple etc, but have not been
    > able to understand how.
    >
    > So, anyone with a completed script or points on how to get started
    > on this ?
    >
    > Ultimate goal is to get rid of people that mail 10Mb+ screenshots
    > to explain a simple thing. PS: if anyone has a pointer on how to
    > do this in Procmail or other scripting languages, fine with me..
    >
    > Thanks


    --
    Dr. Eberhard W. Lisse \ / Obstetrician & Gynaecologist (Saar)
    el108-ARIN / * | Telephone: +264 81 124 6733 (cell)
    PO Box 8421 \ / Please do NOT email to this address
    Bachbrecht, Namibia ;____/ if it is DNS related in ANY way
    Dr Eberhard Lisse, Dec 20, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    1,837
    Jim Gibson
    Nov 15, 2006
  2. Pet Farrari

    Another procmail configuration

    Pet Farrari, Jan 24, 2007, in forum: Perl
    Replies:
    3
    Views:
    2,121
    Randal L. Schwartz
    Jan 28, 2007
  3. Mislav Kasner

    Procmail to ruby

    Mislav Kasner, Nov 5, 2007, in forum: Ruby
    Replies:
    3
    Views:
    189
    Jonathan Hudson
    Nov 6, 2007
  4. J Cardella
    Replies:
    3
    Views:
    178
    Johan Vromans
    Sep 28, 2004
  5. Pet Farrari

    Another procmail configuration

    Pet Farrari, Jan 24, 2007, in forum: Perl Misc
    Replies:
    4
    Views:
    112
    Dr.Ruud
    Jan 25, 2007
Loading...

Share This Page