init.d script for domtool-slave
[hcoop/domtool2.git] / src / main-vmail.sml
index 63ea19d..8acb845 100644 (file)
@@ -23,7 +23,16 @@ val _ =
        [] => print "Invalid command-line arguments\n"
       | domain :: rest =>
        case rest of
-           ["add", user, mailbox] =>
+           ["list"] =>
+           (case Main.requestListMailboxes domain of
+                Vmail.Error msg => (print msg;
+                                    print "\n")
+              | Vmail.Listing users => app (fn {user, mailbox} => (print user;
+                                                                   print "\t";
+                                                                   print mailbox;
+                                                                   print "\n")) users)
+
+         | ["add", user, mailbox] =>
            (case Client.getpass () of
                 Client.Passwd passwd =>
                 Main.requestNewMailbox {domain = domain,