HCoop
/
hcoop
/
domtool2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Manage spamassassin preferences in shared space
[hcoop/domtool2.git]
/
src
/
mail
/
setsa.sml
diff --git
a/src/mail/setsa.sml
b/src/mail/setsa.sml
index
ef60dca
..
32fa0ab
100644
(file)
--- a/
src/mail/setsa.sml
+++ b/
src/mail/setsa.sml
@@
-1,5
+1,6
@@
(* HCoop Domtool (http://hcoop.sourceforge.net/)
* Copyright (c) 2006, Adam Chlipala
(* HCoop Domtool (http://hcoop.sourceforge.net/)
* Copyright (c) 2006, Adam Chlipala
+ * Copyright (c) 2014 Clinton Ebadi <clinton@unknownlamer.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@
-20,6
+21,8
@@
structure SetSA :> SET_SA = struct
structure SetSA :> SET_SA = struct
+open MsgTypes
+
datatype address =
User of string
| Email of string
datatype address =
User of string
| Email of string
@@
-27,7
+30,7
@@
datatype address =
fun address (User s) = s ^ "@localhost"
| address (Email s) = s
fun address (User s) = s ^ "@localhost"
| address (Email s) = s
-fun file addr = OS.Path.joinDirFile {dir = Config.SpamAssassin.addrsD
ir
,
+fun file addr = OS.Path.joinDirFile {dir = Config.SpamAssassin.addrsD
b
,
file = address addr}
fun query addr = Posix.FileSys.access (file addr, [])
file = address addr}
fun query addr = Posix.FileSys.access (file addr, [])
@@
-38,4
+41,13
@@
fun set (addr, setting) =
else
OS.FileSys.remove (file addr)
else
OS.FileSys.remove (file addr)
+fun rebuild () =
+ let
+ fun doNode (site, ok) =
+ (print ("New spamassassin data for node " ^ site ^ "\n");
+ Connect.commandWorker (Domain.get_context (), site, MsgSaChanged))
+ in
+ foldl doNode true Config.mailNodes_all
+ end
+
end
end