English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Netmime: parsing a nested multipart message
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-06-14 (13:55)
From: Johann Spies <jspies@s...>
Subject: Netmime: parsing a nested multipart message

I have to add a disclaimer on server level to emails.

In order to do that I want to add the disclaimer to the first 
"`Body <obj>" of a message.  At the moment I have success with
messages with the following stuctures:

Netmime.complex_mime_message = (<obj>, `Body <obj>)
(<obj>, `Parts [(<obj>, `Body <obj>); (<obj>, `Body <obj>);...])

but I am struggling with the following one:

- : Netmime.complex_mime_message =
   [(<obj>, `Parts [(<obj>, `Body <obj>); (<obj>, `Body <obj>)]);
    (<obj>, `Body <obj>); (<obj>, `Body <obj>); (<obj>, `Body <obj>)])

I cannot predict how deep the nesting would be and so far was
unsuccessful in my effort to parse the tree recursively to get the
first `Body <obj>)

I would appreciate some help please.

Johann Spies          Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

     "I beseech you therefore, brethren, by the mercies of 
      God, that ye present your bodies a living sacrifice, 
      holy, acceptable unto God, which is your reasonable 
      service."       Romans 12:1 

VRYWARING: Hierdie vrywaring is bloot 'n toets...  

DISCLAIMER:  This disclaimer was just added as a test...