Browse Source

add response for UNDELIVERABLE

Pi 1 year ago
parent
commit
776b7a3755
3 changed files with 12 additions and 3 deletions
  1. 6 3
      cropswap-sendmail.sh
  2. 1 0
      maildroprc
  3. 5 0
      responses/6.html

+ 6 - 3
cropswap-sendmail.sh

@@ -77,7 +77,10 @@ fi
 
 "$DEBUGMAIL" "delivered:$DELIVERED" < mail || true
 if ! $DELIVERED; then
-	exit "$UNHANDLED"
-else
-	exit 0
+	EXITCODE="$UNDELIVERABLE"
+	RESP="${RESPDIR}/${EXITCODE}.html"
+	FROM="$NOFORWARD"
+	export RESP FROM
+	"$MAILBOT" < mail
 fi
+exit 0

+ 1 - 0
maildroprc

@@ -19,6 +19,7 @@ if ($TEST)
    import MAILDROPDIR
 }
 
+UNDELIVERABLE=6
 UNHANDLED=5
 BADREQUEST=4
 UNREGISTERED=3

+ 5 - 0
responses/6.html

@@ -0,0 +1,5 @@
+<html><head></head><body>
+<p>Your message could not be delivered.
+<p>This is most likely because you have addressed an individual recipient and their email is not currently subscribed.
+<p>If you believe this to be an error, then you may contact the organizers for assistance by sending an e-mail to <a href="mailto:cropswap@shandan.one">cropswap@shandan.one</a>
+</body></html>