procmail
[Top] [All Lists]

Re: Remove parts of a message (MIME attachment)?

1996-03-23 16:55:40
At 10:33 96-03-23, Era Eriksson wrote:

These messages will
contain a MIME attachment towards the end of the message, something
like this:

------ =_NextPart_000_01BB1736.819C5640
Content-Type: application/ms-tnef
Content-Transfer-Encoding: base64

eJ8+IjcTAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAENgAQAAgAAAAIAAgABBJAG
AEABAAABAAAADAAAAAMAADADAAAACwAPDgAAAAACAf8PAQAAAFMAAAAAAAAAgSsfpL6jEBmdbgDd
AQ9UAgAAAABUaGUgUXVhcmsgRXhwcmVzcyBMaXN0AFNNVFAAUVVBUktYUFJASVVCVk0uVUNTLklO
<... spare you the rest ... :->

 What I was wondering is, has somebody written a Procmail filter to
zap these attachments from incoming mail? Not the whole message, just

The following just came across the SmartList list a day or so ago.
Personally, I haven't had to use it. Looks like it might need a tweek
or tow:

At 12:54 96-03-21, b_weissm(_at_)kla(_dot_)com (Bob Weissman) wrote:

On Mar 21,  3:04pm -0500, "Michael C Tiernan"
<mtiernan(_at_)nomad(_dot_)n-reading(_dot_)ma(_dot_)us> wrote:
  I've got a user who's system sends some stupid attachment on
  the end of every mail.  As far as I can guess, it's them
  sending a copy of all the fonts that the message MIGHT use to
  be displayed.  It's chewing up so much space it's killin' me.

I get these, too.  But procmail is perfect for this:

:0fbw
*   ^X-Ms-Attachment: WINMAIL\.DAT
   |sed '/^begin [0-7][0-7][0-7] WINMAIL\.DAT$/,/^end$/d'

:0fbw
*   ^Content-Type: multipart/mixed
   |sed '/^Content-Type: application\/ms-tnef/,$d'

:0fbw
*   ^X-Nvl-Content-Type: MULTIPART;
   |sed
'/^--\$----Novell--Attachment----\$$/,/^--\$----Novell--Attachment----
\$$/d'

--Hal
Hal Wine <hal(_at_)dtor(_dot_)com>     voice: 510/482-0597


<Prev in Thread] Current Thread [Next in Thread>