Remove catchAllAlias in favor of defaultAlias; add better handling of slave servers...
authorAdam Chlipala <adamc@hcoop.net>
Wed, 20 Jun 2007 23:43:21 +0000 (23:43 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Wed, 20 Jun 2007 23:43:21 +0000 (23:43 +0000)
lib/alias.dtl
lib/easy_domain.dtl
src/main.sml
src/openssl.sml

index 10f7dde..113654b 100644 (file)
@@ -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.}}
index 925802d..03af55f 100644 (file)
@@ -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
index fd4ff63..87f2869 100644 (file)
@@ -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;
index df63276..d309a61 100644 (file)
@@ -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)