On Wed, 05 Jan 2000 10:30:24 +0100, Thomas Stridh <[log in to unmask]> said: > My question is how can I detect that a mail is containing a attachment > and how can I remove it from the stream, change it and replace it in the > stream again? This is a lot harder to do correctly than it looks, especially for mail like this one, which has a digital signature attached to it. Modifying the body will invalidate the signature. In addition, if you are trying to deal with a MIME multipart/alternative or similar, trying to remove the "right" bodypart can be.. umm... interesting. You might want to ask yourself *why* you are trying to remove attachments, and if there's another way to address the problem. If you're trying to limit oversized mail, the SIZELIM= parameter is probably what you *SHOULD* be using, as it will also fix oversized non-attachment mail. If you're trying to security-check or virus-check mail, I recommend you do that in your mail hub using a seperate software package, and *not* removed attachments that are found problem-free. In any case, removing an attachment will probably result in lots of people complaining "I can't read the attachment, it seems to be missing". You will even get complaints from people who usually don't like attachments. Re-inserting a modified stream may get you into serious trouble - consult a qualified lawyer regarding your liability. That's just a little *too* close to real-time revisionism, and probably worse than simply rejecting/bouncing the note back with some explanitory text of why it wasn't posted to the list. And rememer - attachments aren't *inherently* evil, there was a REASON why MIME was ever invented. Those of us who were around in the pre-MIME days remember 'uuencode' and all the OTHER ad-hackery that MIME was designed to fix..... -- Valdis Kletnieks Operating Systems Analyst Virginia Tech