Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Filter for mail attachment size ? (to be used from Procmail or similar)

Reply
Thread Tools

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

 
 
Horst Lemminger
Guest
Posts: n/a
 
      12-20-2011
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
 
Reply With Quote
 
 
 
 
Dr Eberhard Lisse
Guest
Posts: n/a
 
      12-20-2011
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)
http://www.velocityreviews.com/forums/(E-Mail Removed) 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Procmail Regex Indo Geek Computer Support 2 05-11-2007 05:27 PM
Another procmail configuration Pet Farrari Perl 3 01-28-2007 09:30 PM
removing procmail garbage surfergirl@thebeach.com Perl 1 11-15-2006 05:11 PM
Procmail Shane NZ Computing 2 01-14-2006 03:12 AM
Mail filtering without procmail using webmail client J Cardella Perl Misc 3 09-28-2004 05:04 PM



Advertisments