X-Git-Url: http://git.hcoop.net/hcoop/zz_old/portal.git/blobdiff_plain/f3c869483b22c1d5383eeee00a2181d9b494c73d..893fd779b713766c05b7074903031c05360f4697:/vmailpasswd/pass.sml diff --git a/vmailpasswd/pass.sml b/vmailpasswd/pass.sml new file mode 100644 index 0000000..c78c84b --- /dev/null +++ b/vmailpasswd/pass.sml @@ -0,0 +1,24 @@ +structure Pass :> PASS = +struct + +fun validEmail email = + case String.fields (fn ch => ch = #"@") email of + [_, dom] => dom <> "localhost" + | _ => false + +val vmp = "/usr/local/bin/vmailpasswd" + +fun change (email, old, new) = + let + val cmd = String.concat ["/usr/local/bin/vmailpasswd \"", + String.toString email, + "\" \"", + String.toString old, + "\" \"", + String.toString new, + "\" >/dev/null 2>/dev/null"] + in + OS.Process.isSuccess (OS.Process.system cmd) + end + +end