D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [LUG] attachments & procmail



On 26-Sep-00 at 17:01:34 Alex Charrett wrote:
> Does anyone know if you can filter off mail with attachment using 
> procmail?
> 
Yes I think so - if I read your message right. The mail message will be MIME
encoded with this type of header embedded into it:

--Boundary-=_nWlrBbmQBhCDarzOwKkYHIDdqSCD
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

The initial headers must specify what the 'boundary' is by using:

Content-Type: Multipart/Mixed;
              boundary="Boundary-=_nWlrBbmQBhCDarzOwKkYHIDdqSCD"

So by filtering the mail looking for something like 'boundary=' should
filter out mail with attachments. You will need to be careful with the
expression you use in the test since you don't want to filter plain text
mail that simply contains 'boundary=' somewhere and secondly there may be
clients that use different wording (the MIME RFC's should probably specify
what is allowed).


John.

------------------------------------------------------------------------
John Horne, University of Plymouth, UK           Tel: +44 (0)1752 233914
E-mail: jhorne at plymouth.ac.uk
PGP key available from public key servers
--
lug-list - The Mailing List for the Devon & Cornwall LUG
Mail majordomo at lists.termisoc.org with "unsubscribe lug-list" in the
message body to unsubscribe.


Lynx friendly