The example that follows is the text of a sample input message the program in Example 5–2 is to process. The second message part is a file attachment. The attached file name is trojan_horse.vbs. Consequently when this message is processed by the channel, it should remove the attachment as the file extension .vbs is in the list of harmful file extensions. The sample program replaces the attachment with a text attachment indicating the content has been deleted.
Received: from [220.127.116.11] ([18.104.22.168]) by frodo.siroe.com (Sun Java System Messaging Server 6 2004Q2 (built Apr 7 2003)) with SMTP id <0HD7001023OYDA00@frodo.siroe.com\> for for firstname.lastname@example.org; Fri, 11 Apr 2003 13:03:23 -0700 (PDT) Date: Fri, 11 Apr 2003 13:03:08 -0700 From: email@example.com Subject: test message Message-id: <0HD7001033P1DA00@frodo.siroe.com\> Content-type: multipart/mixed; boundary=BoundaryMarke --BoundaryMarker Content-type: text/plain; charset=us-ascii Content-disposition: inline This is a test message! --BoundaryMarker Content-type: application/octet-stream Content-disposition: attachment; filename="trojan_horse.vbs" Content-transfer-encoding: base64 IyFQUwoxMDAgMTAwIG1vdmV0byAzMDAgMzAwIGxpbmV0byBzdHJva2UKc2hvd3Bh Z2UK --BoundaryMarker--