From: Adam Chlipala Date: Wed, 20 Jun 2007 23:43:21 +0000 (+0000) Subject: Remove catchAllAlias in favor of defaultAlias; add better handling of slave servers... X-Git-Tag: release_2010-11-19~193 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/16465a9ab10d41506006aa27499513a42d2b7de6?hp=d307ad55e460dd1ceb4fa0601e45546e2f2a87d3 Remove catchAllAlias in favor of defaultAlias; add better handling of slave servers being down --- diff --git a/lib/alias.dtl b/lib/alias.dtl index 10f7dde..113654b 100644 --- a/lib/alias.dtl +++ b/lib/alias.dtl @@ -41,8 +41,5 @@ val aliasDrop = \user -> aliasPrim (userSource user) dropTarget; {{Silently delete mail to the user at the current domain.}} val defaultAlias = \email -> aliasPrim defaultSource (addressTarget email); -{{When a message to the current domain doesn't match any other alias, and it - doesn't match any systemwide username, send it to this e-mail address.}} -val catchAllAlias = \email -> aliasPrim catchAllSource (addressTarget email); -{{When a message to the current domain doesn't match any other alias, send it - to this e-mail address, even if it matches a systemwide username.}} +{{When a message to the current domain doesn't match any other alias, send it to + this e-mail address.}} diff --git a/lib/easy_domain.dtl b/lib/easy_domain.dtl index 925802d..03af55f 100644 --- a/lib/easy_domain.dtl +++ b/lib/easy_domain.dtl @@ -24,14 +24,15 @@ val dom = dns (dnsNS "ns1.hcoop.net"); dns (dnsNS "ns3.hcoop.net"); - dns (dnsDefaultA (ip_of_node default_node)); + dns (dnsDefaultA (ip_of_node (web_node_to_node web_node))); handleMail; dns (dnsMX 1 "deleuze.hcoop.net"); mailbox <- Mailbox; - catchAllAlias mailbox; + defaultAlias mailbox; web "www" with + serverAliasDefault end; config diff --git a/src/main.sml b/src/main.sml index fd4ff63..87f2869 100644 --- a/src/main.sml +++ b/src/main.sml @@ -836,7 +836,8 @@ fun regenerate context = | _ => print ("Slave " ^ node ^ " returned unexpected command\n"); OpenSSL.close bio - end + end + handle OpenSSL.OpenSSL s => print ("OpenSSL error: " ^ s ^ "\n") fun doUser user = let @@ -943,8 +944,10 @@ fun service () = print "\n"; Msg.send (bio, MsgOk))) handle e as (OpenSSL.OpenSSL s) => - (print "OpenSSL error\n"; - app (fn x => print (x ^ "\n")) (SMLofNJ.exnHistory e)) + (print ("OpenSSL error: " ^ s ^ "\n"); + app (fn x => print (x ^ "\n")) (SMLofNJ.exnHistory e); + Msg.send (bio, MsgError ("OpenSSL error: " ^ s)) + handle OpenSSL.OpenSSL _ => ()) | OS.SysErr (s, _) => (print "System error: "; print s; diff --git a/src/openssl.sml b/src/openssl.sml index df63276..d309a61 100644 --- a/src/openssl.sml +++ b/src/openssl.sml @@ -53,7 +53,8 @@ fun ssl_err s = if C.Ptr.isNull reason then () else - print (ZString.toML reason) + print (ZString.toML reason); + print "\n" end val readBuf : (C.uchar, C.rw) C.obj C.ptr' = C.alloc' C.S.uchar (Word.fromInt Config.bufSize)