(* HCoop Domtool (http://hcoop.sourceforge.net/)
- * Copyright (c) 2006, Adam Chlipala
+ * Copyright (c) 2006-2007, Adam Chlipala
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
| ["add", user, mailbox] =>
(case Client.getpass () of
Client.Passwd passwd =>
- Main.requestNewMailbox {domain = domain,
- user = user,
- passwd = passwd,
- mailbox = mailbox}
+ let
+ val mailbox = if size mailbox > 0
+ andalso String.sub (mailbox, 0) <> #"/" then
+ let
+ val uid = Posix.ProcEnv.getuid ()
+ val user = Posix.SysDB.getpwuid uid
+ val home = Posix.SysDB.Passwd.home user
+ in
+ home ^ "/" ^ mailbox
+ end
+ else
+ mailbox
+ in
+ Main.requestNewMailbox {domain = domain,
+ user = user,
+ passwd = passwd,
+ mailbox = mailbox}
+ end
| _ => ())
| ["passwd", user] =>
SOME "Invalid password; may only contain printable, non-space characters")
else if not (Domain.yourPath mailbox) then
("User wasn't authorized to add a mailbox at " ^ mailbox,
- SOME "You're not authorized to use that mailbox location.")
+ SOME ("You're not authorized to use that mailbox location. ("
+ ^ mailbox ^ ")"))
else
case Vmail.add {requester = user,
domain = domain, user = emailUser,