Gary Johnson wrote: > On 2012-11-27, mutt wrote: > > Jamie Paul Griffin wrote: > > > > > Hi > > > > > > Does anyone have or know of a perl or python script, or even a shell > > > script, that removes the multipart/(mixed|alternative| ... ) parts of > > > incoming mail and leaves or converts the message into plain text? > > > Also, i wouldn't want to lose any attachments that people might send me. > > > > > > Jamie. > > > > hi, > > > > i wrote something like that. by default, it converts to text anything > > that can be converted to text and deletes everything else but you > > can turn off any specific transformation. it can delete specific > > mail headers. it translates (most) winmail.dat attachments. if a > > transformation fails, it leaves the original in place for safety by > > default. it works via procmail on individual messages or it can be > > applied to an entire mbox file. > > > > it requires the presence of various utilities (e.g. perl, antiword > > or catdoc, xls2csv, lynx, pdftotext and mktemp). you'd probably just > > need lynx and mktemp installed. > > Why aren't you all using mutt's built-in ability to select > MIME-type-to-text converters? There's no risk of losing a message > through improper conversion, you have some limited choice over > conversion methods (depending on whether the message/attachment is > displayed by the pager or via the attachment menu), and since the > message itself is unaffected, you can use different methods of > viewing messages in different environments and at different times as > your methods improve. > > Regards, > Gary
the phrase "the message itself is unaffected" is the main reason. i wanted to delete/convert the attachments permanently. what you suggest wouldn't do that. i was receiving many large emails in my work mailbox at the time. they were large because they contained many useless attachments. i wanted to keep the semantic content of the messages and i wanted to delete the useless parts of the messages. by doing so, my mailbox was about a tenth of the size it would otherwise have been.