mail: Send mail with the correct envelope sender.
[newsgate] / defs
diff --git a/defs b/defs
index b7ac630..52e7f25 100644 (file)
--- a/defs
+++ b/defs
@@ -7,6 +7,17 @@ QMAIL=/var/qmail
 PATH=$NEWS/bin:$QMAIL/bin:$HOME/bin:$PATH
 export PATH
 
-bad () { echo >&2 "newsgate: fatal: $@"; exit 100; }
-fail () { echo >&2 "newsgate: $@"; exit 111; }
+bad () { echo >&2 "newsgate: fatal: $*"; exit 100; }
+fail () { echo >&2 "newsgate: $*"; exit 111; }
 
+control () {
+  if [ -r $QMAIL/control/$1 ]; then
+    cat $QMAIL/control/$1
+  elif [ "${2+yes}" ]; then
+    echo "$2"
+  else
+    bad "control $1 not found"
+  fi
+}
+
+me=$(control me)