diff options
author | Guilhem Moulin <guilhem.moulin@fripost.org> | 2012-09-17 02:32:51 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@fripost.org> | 2012-09-17 02:32:51 +0200 |
commit | 81709521a343934d176be735d430005c26f4033d (patch) | |
tree | d2ae7e0abde32aa6aff44823bdd7307d145ffebe | |
parent | 2dce264ab39c825bd737a2f369b2cfcda295add0 (diff) |
postfix-to-schleuder
-rw-r--r-- | scripts/postfix-to-schleuder.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/postfix-to-schleuder.sh b/scripts/postfix-to-schleuder.sh new file mode 100644 index 0000000..0e0b3b9 --- /dev/null +++ b/scripts/postfix-to-schleuder.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# Strip out the list command from a fully qualified (using '#' in place of +# '@') mailing list, and replace '#' by '@'. + +ADDR="${1}" +SCHLEUDER=/usr/bin/schleuder + +[ -n "${ADDR}" ] || exit 1 + +LOCAL="${ADDR%%#*}" +DOMAIN="${ADDR#*#}" +LOCAL2="${LOCAL%-bounces}" +[ x"${LOCAL}" != x"${LOCAL2}" ] || LOCAL2="${LOCAL%-sendkey}" +LOCAL="${LOCAL2}" + +if [ x"${DOMAIN}" != x"${ADDR}" ]; then + ADDR="${LOCAL}@${DOMAIN}" +else + ADDR="${LOCAL}" +fi + +${SCHLEUDER} "${ADDR}" |