893fd779 |
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 | |
893fd779 |
9 | fun 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 | |
22 | end |