cvsimport
[hcoop/zz_old/portal.git] / vmailpasswd / pass.sml
CommitLineData
893fd779 1structure Pass :> PASS =
2struct
3
4fun validEmail email =
5 case String.fields (fn ch => ch = #"@") email of
6 [_, dom] => dom <> "localhost"
7 | _ => false
8
893fd779 9fun change (email, old, new) =
10 let
10d1a16d 11 val cmd = String.concat ["/usr/bin/sudo /usr/local/bin/vmailpasswd \"",
893fd779 12 String.toString email,
13 "\" \"",
14 String.toString old,
15 "\" \"",
16 String.toString new,
047812d5 17 "\" >/dev/null 2>/dev/null"]
893fd779 18 in
19 OS.Process.isSuccess (OS.Process.system cmd)
20 end
21
22end