(* ************************************************************** *)
(* mbox-cleaner                                                   *)
(* deletes superflous mails of mbox, which has same body.         *)
(* only ONE instance of such mails will survive                   *)
(* -------------------------------------------------------------- *)
(* Copyright: Oliver Bandel, Germany                              *)
(* Program-Version: Version 1.0.0 (Sun Apr  3 18:26:19 CEST 2005) *)
(* ************************************************************** *)
(* No warranty on this program - use on your own risk.            *)
(* Redistribution under GPL, Vers. 2 is possible.                 *)
(* ************************************************************** *)

type mailentry_t = { mutable md5: string; mutable header: string; mutable body: string; mutable pos: int }

(* -------------------------------------------------------------- *)
(* this function prints the (header, body) pair (prints one mail) *)
(* -------------------------------------------------------------- *)
let printstuff mail = match mail with
    (h,b) -> print_string  h;
    print_string  b


(* ------------------- *)
(* print out all mails *)
(* ------------------- *)
let print_all_mails mailliste = List.iter printstuff mailliste



(* ------------------- *)
(*    main program     *)
(* ------------------- *)
let _ =
  let uniqmails = Mbox_lexer.collect_uniq stdin in
     print_all_mails uniqmails