Easy_domain: Use DefaultAliasSource for DefaultAlias
authorClinton Ebadi <clinton@unknownlamer.org>
Sat, 29 Mar 2014 01:35:05 +0000 (21:35 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Sat, 29 Mar 2014 01:35:05 +0000 (21:35 -0400)
A catch-all alias by default is deprecated. Rather than eliminating a
default email alias entirely, it will soon default to
$hcoop-username@$domain. Use new DefaultAliasSource environment
variable to change. The default is still a catch-all temporarily.

lib/easy_domain.dtl
src/plugins/easy_domain.sml

index 60295b2..26f1eb7 100644 (file)
@@ -37,7 +37,8 @@ val webAtIp =
 
 val addDefaultAlias = begin
   mailbox <- Mailbox;
-  defaultAlias mailbox
+  source <- DefaultAliasSource;
+  aliasPrim source (addressTarget mailbox)
 end;
 
 val addWww = begin
index e486e60..fafe4d5 100644 (file)
@@ -1,5 +1,6 @@
 (* HCoop Domtool (http://hcoop.sourceforge.net/)
  * Copyright (c) 2007, 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
@@ -42,6 +43,10 @@ val _ = Defaults.registerDefault ("DefaultAlias",
                                  (TBase "bool", dl),
                                  (fn () => (EVar "true", dl)))
 
+val _ = Defaults.registerDefault ("DefaultAliasSource",
+                                 (TBase "aliasSource", dl),
+                                 (fn () => (EApp ((EVar "defaultSource", dl), (EString (Domain.getUser ()), dl)), dl)))
+
 val _ = Defaults.registerDefault ("HandleMail",
                                  (TBase "bool", dl),
                                  (fn () => (EVar "true", dl)))