On Tue, 2009-05-19 at 15:05 +0200, Michael Monnerie wrote: > Nope. It needs to modify the body as well. We have a lengthy "this is > SPAM" text in the beginning of recognized Spam, with the original mail > attached. this way, it cannot "happen" that users "accidentally" click > on stupid Viagra links. So the program needs to know this, and grep > the original mail out of all that mess. Nothing for formail. > Thats a much more complex problem than your original requirement to strip out headers. You'll not get good solutions if you hide part of the problem. Anyway, do you mean that the attachment is the complete original message, i.e. the attachment contains the original headers and body including all MIME parts? If so, it should be fairly easy to extract the original message with the aid of FOSS mail processing libraries. It would be pretty straight-forward to implement in Java with the JavaMail extension (and mstor if the messages must be read from mbox files).
> And sometimes messages are encrypted twice, when they arrive over > certain paths. But that's an extra mess. > As you say, that's another story but probably do-able if you can recognise the encryption schemes. Martin