summaryrefslogtreecommitdiffstats
path: root/src/cmd/upas/misc/mail.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-10-29 16:26:44 +0000
committerrsc <devnull@localhost>2005-10-29 16:26:44 +0000
commit5cdb17983ae6e6367ad7a940cb219eab247a9304 (patch)
tree8ca1ef49af2a96e7daebe624d91fdf679814a057 /src/cmd/upas/misc/mail.c
parentcd3745196389579fb78b9b01ef1daefb5a57aa71 (diff)
downloadplan9port-5cdb17983ae6e6367ad7a940cb219eab247a9304.tar.gz
plan9port-5cdb17983ae6e6367ad7a940cb219eab247a9304.zip
Thanks to John Cummings.
Diffstat (limited to 'src/cmd/upas/misc/mail.c')
-rw-r--r--src/cmd/upas/misc/mail.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/cmd/upas/misc/mail.c b/src/cmd/upas/misc/mail.c
new file mode 100644
index 00000000..20cf2397
--- /dev/null
+++ b/src/cmd/upas/misc/mail.c
@@ -0,0 +1,51 @@
+/*
+ * #!/bin/sh
+ * case $1 in
+ * -n)
+ * exit 0 ;;
+ * -m*|-f*|-r*|-p*|-e*|"")
+ * exec /usr/lib/upas/edmail $*
+ * exit $? ;;
+ * *)
+ * exec /usr/lib/upas/send $*
+ * exit $? ;;
+ * esac
+ */
+
+
+extern *UPASROOT;
+
+#define EDMAIL "edmail"
+#define SEND "send"
+
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ char *progname = SEND;
+ char realprog[500];
+
+ if (argc > 1) {
+ if (argv[1][0] == '-') {
+ switch (argv[1][1]) {
+ case 'n':
+ exit (0);
+
+ case 'm':
+ case 'f':
+ case 'r':
+ case 'p':
+ case 'e':
+ case '\0':
+ progname = EDMAIL;
+ }
+ }
+ } else
+ progname = EDMAIL;
+
+ sprint(realprog, "%s/%s", UPASROOT, progname);
+ execv (realprog, argv);
+ perror (realprog);
+ exit (1);
+}
+