X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/8ca17b9a328732cac9ccd9e1c96c8d35777afe88..ebb51f80568cc35cf3cd2f99a31a28f72526798d:/src/mail/setsa.sml diff --git a/src/mail/setsa.sml b/src/mail/setsa.sml index ef60dca..32fa0ab 100644 --- 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 + * Copyright (c) 2014 Clinton Ebadi * * 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 +open MsgTypes + 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 file addr = OS.Path.joinDirFile {dir = Config.SpamAssassin.addrsDir, +fun file addr = OS.Path.joinDirFile {dir = Config.SpamAssassin.addrsDb, 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) +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