From: Johann Spies <jspies@sun.ac.za>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Netmime: parsing a nested multipart message
Date: Wed, 15 Jun 2005 08:11:06 +0200 [thread overview]
Message-ID: <20050615061106.GD23373@sun.ac.za> (raw)
In-Reply-To: <20050614135528.GB14644@sun.ac.za>
On Tue, Jun 14, 2005 at 03:55:28PM +0200, Johann Spies wrote:
>
> - : Netmime.complex_mime_message =
> (<obj>,
> `Parts
> [(<obj>, `Parts [(<obj>, `Body <obj>); (<obj>, `Body <obj>)]);
> (<obj>, `Body <obj>); (<obj>, `Body <obj>); (<obj>, `Body <obj>)])
>
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 = <fun>
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...
prev parent reply other threads:[~2005-06-15 6:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-14 13:55 Johann Spies
2005-06-15 6:11 ` Johann Spies [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050615061106.GD23373@sun.ac.za \
--to=jspies@sun.ac.za \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).