- let
- val proc = Unix.execute ("/bin/sh", ["-c",
- String.concat [Config.Courier.userdbpw, " | ", Config.Courier.userdb,
- " \"", domain, "/", user, "@", domain, "\" set systempw"]])
- val outf = Unix.textOutstreamOf proc
- in
- TextIO.output (outf, String.concat [passwd, "\n", passwd, "\n"]);
- TextIO.closeOut outf;
- if not (OS.Process.isSuccess (Unix.reap proc)) then
- (ignore (Slave.shell [Config.Courier.userdb, " \"", domain, "/", user, "@", domain, "\" del"]);
- SOME "Error setting password")
- else if not (rebuild ()) then
- (ignore (Slave.shell [Config.Courier.userdb, " \"", domain, "/", user, "@", domain, "\" del"]);
- SOME "Error reloading userdb")
- else
- NONE
- end