From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 4EA36BCAF for ; Wed, 15 Jun 2005 08:11:09 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5F6B8vJ019694 for ; Wed, 15 Jun 2005 08:11:09 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA21369 for ; Wed, 15 Jun 2005 08:11:08 +0200 (MET DST) Received: from mail3.sun.ac.za (mail3.sun.ac.za [146.232.64.13]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5F6B7v0019691 for ; Wed, 15 Jun 2005 08:11:08 +0200 Received: from burger.sun.ac.za ([146.232.128.30]) by mail3.sun.ac.za with esmtp (Exim 4.34) id 1DiR7C-00088t-KQ for caml-list@inria.fr; Wed, 15 Jun 2005 08:11:07 +0200 Received: from js by burger.sun.ac.za with local id 1DiR7C-00077g-IL for ; Wed, 15 Jun 2005 08:11:06 +0200 Date: Wed, 15 Jun 2005 08:11:06 +0200 From: Johann Spies To: caml-list@inria.fr Message-Id: <20050615061106.GD23373@sun.ac.za> In-Reply-To: <20050614135528.GB14644@sun.ac.za> References: <20050614135528.GB14644@sun.ac.za> Subject: Re: [Caml-list] Netmime: parsing a nested multipart message Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Disclaimer: added Mail-Followup-To: Johann Spies , caml-list@inria.fr X-Miltered: at nez-perce with ID 42AFC67C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42AFC67B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; spies:01 jspies:01 caml-list:01 parsing:01 spies:01 rec:01 val:01 universiteit:01 stellenbosch:01 021:98 ...:98 ...:98 wrote:01 johann:01 johann:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Tue, Jun 14, 2005 at 03:55:28PM +0200, Johann Spies wrote: > > - : Netmime.complex_mime_message = > (, > `Parts > [(, `Parts [(, `Body ); (, `Body )]); > (, `Body ); (, `Body ); (, `Body )]) > Thanks to Remi Vanicat who helped me. The following code seems to work: # let handle ( mesg : Netmime.complex_mime_message) = match mesg with (header,`Body bb) -> handle_simple_message mesg | (header, `Parts body) -> let rec aux body = match body with [] -> () | (_ , `Body b)::_ -> if not (List.mem("US-diclaimer", "added") header#fields) then begin add_header header; add_disclaimer b; writemessage mesg; end | (_, `Parts l)::_ -> aux l in aux body; writemessage mesg;; val handle : Netmime.complex_mime_message -> unit = Regards Johann -- Johann Spies Telefoon: 021-808 4036 Informasietegnologie, Universiteit van Stellenbosch "Cease from anger, and forsake wrath; do not fret- it leads only to evil." Psalms 37:8 VRYWARING: Hierdie vrywaring is bloot 'n toets... DISCLAIMER: This disclaimer was just added as a test...