|
@@ -3,27 +3,16 @@ set -euo pipefail
|
|
|
ACTION="$1"
|
|
|
FROM="$2"
|
|
|
|
|
|
-if [ "$ACTION" == "SIGNUP" ]; then
|
|
|
- TO=postmaster@localhost
|
|
|
- HEADER="$(cat <<EOF
|
|
|
-$(cat -)
|
|
|
-EOF
|
|
|
-)"
|
|
|
-else
|
|
|
- TO=$(cat - | formail -X 'X-GROUP')
|
|
|
- HEADER="X-IGNORED:"
|
|
|
-fi
|
|
|
-
|
|
|
#
|
|
|
# Ideally, FROM should be "postmaster" or "root" or something
|
|
|
-# but to keep the logic (at this time) simpler
|
|
|
+# but to keep the logic (at this time) simpler,
|
|
|
# I impersonate the user
|
|
|
#
|
|
|
# However, the origin of these e-mails are still disambiguated
|
|
|
# by the "From: " header
|
|
|
maildrop -f "$FROM" <<EOF
|
|
|
From: postmaster@localhost
|
|
|
-To: ${TO}
|
|
|
+To: postmaster@localhost
|
|
|
Subject: [${ACTION}]
|
|
|
-${HEADER}
|
|
|
+$(cat -)
|
|
|
EOF
|