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