(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mail_import.ml,v 1.3 2004/10/11 16:07:25 rich Exp $
+ * $Id: mail_import.ml,v 1.5 2004/10/14 15:57:15 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
open Cocanwiki_date
open Cocanwiki_strings
open Cocanwiki_pages
+open Cocanwiki_mail
let irt_re = Pcre.regexp "<.*?>"
let ws_re = Pcre.regexp "\\s+"
upload.upload_value
with
Not_found ->
- (* Force an error status which a script can detect. *)
- Request.set_status r cHTTP_BAD_REQUEST;
error ~back_button:true ~title:"No message"
q "No message was uploaded.";
return () in
* cannot thread it, so give up.
*)
if date = "" || inet_message_id = "" then (
- Request.set_status r cHTTP_BAD_REQUEST;
error ~back_button:true ~title:"Headers missing"
q "Date or Message-ID header missing. Cannot handle this message. ";
return ()
*)
save_page dbh hostid ~user ~r model;
+ (* Rebuild threads? *)
+ if rebuild then
+ thread_mail dbh hostid date.Dbi.year date.Dbi.month;
+
(* Commit to the database. *)
dbh#commit ();