before TextIO.closeIn inf
end
-fun readTosBody () = readFile "/var/www/home/html/tos.body.html"
-fun readTosAgree () = readFile "/var/www/home/html/tos.agree.html"
-fun readTosMinorAgree () = readFile "/var/www/home/html/tos.agree.minor.html"
+fun readTosBody () = readFile "/home/hcoop/public_html/tos.body.html"
+fun readTosAgree () = readFile "/home/hcoop/public_html/tos.agree.html"
+fun readTosMinorAgree () = readFile "/home/hcoop/public_html/tos.agree.minor.html"
end
<tr> <td align="right" valign="top"><b>Reason</b>:</td> <td colspan="2"><% Web.html (#msg req) %></td> </tr>
</table>
-<% if admin then %>
+<% if admin then
+ val (user, dom) = MailingList.listWebHost (#data req) %>
<br>
<a href="list?mod=<% #id req %>">[Modify]</a>
<a href="list?del=<% #id req %>">[Delete]</a><br>
- To set up, run: <tt>newlist <% #data req %> <% name %><% Init.emailSuffix %> <% Util.randomPassword () %></tt>
+ To set up, run: <tt>listnew <% user %> <% dom %> <% name %> <% Util.randomPassword () %></tt>
<% end %>
<% end
<p>Enter here the e-mail address you would like for your list. Please keep in mind that the part of your list address before the "@" must be unique across all mailing lists we run. We may reject applications with overly general names here, especially names of current users or UNIX usernames that are likely to be chosen by future members. The "Reason" field is optional.</p>
-<p>If you want to use the Mailman web interface on your new list, and you want this to appear on a different web virtual host than hcoop.net, you should create a file <tt>.mailman</tt> in the domtool directory for this domain, before submitting a request. In that file, put the hostname of the vhost you want to use.</p>
+<p>If you want to use the Mailman web interface on your new list, and you want this to appear on a different web virtual host than hcoop.net, you should create a file <tt>.mailman</tt> in the domtool directory for this domain, before submitting a request. In that file, put the hostname of the vhost you want to use, and be sure to include a <tt>Mailman</tt> directive in that vhost's configuration.</p>
<form action="list">
<table>
-structure MailingList = Request(struct
- val table = "MailingList"
- val adminGroup = "lists"
- fun subject list = "Mailman list request: " ^ list
- val template = "list"
- val descr = "mailing list"
-
- fun body (mail, lst) =
- (Mail.mwrite (mail, "List name: ");
- Mail.mwrite (mail, lst);
- Mail.mwrite (mail, "\n"))
- end)
+structure MailingList =
+struct
+
+structure R = Request(struct
+ val table = "MailingList"
+ val adminGroup = "lists"
+ fun subject list = "Mailman list request: " ^ list
+ val template = "list"
+ val descr = "mailing list"
+
+ fun body (mail, lst) =
+ (Mail.mwrite (mail, "List name: ");
+ Mail.mwrite (mail, lst);
+ Mail.mwrite (mail, "\n"))
+ end)
+open R
+
+fun listWebHost name =
+ case String.tokens (fn ch => ch = #"@") name of
+ [user, dom] =>
+ let
+ val mmf = Util.domainDir dom ^ "/.mailman"
+ in
+ if Posix.FileSys.access (mmf, []) then
+ let
+ val inf = TextIO.openIn mmf
+ in
+ (case TextIO.inputLine inf of
+ NONE => (user, dom)
+ | SOME line =>
+ (user, String.substring (line, 0, size line - 1)))
+ before TextIO.closeIn inf
+ end handle _ => (user, dom)
+ else
+ (user, dom)
+ end
+ | _ => raise (Fail "Bad mailing list name")
+
+end
val whoisUrl : string -> string
val randomPassword : unit -> string
-end
\ No newline at end of file
+
+ val domainDir : string -> string
+end
fun randomPassword () = Int.toString (Int.abs (Random.randInt (!rnd)))
-end
\ No newline at end of file
+fun domainDir dom =
+ String.concatWith "/" ("/etc/domains" :: String.fields (fn ch => ch = #".") dom)
+
+end