Here's a wrapper for couriermlm that allows posting only from addresses
that match a regular expression specified with POSTADDRESS in the mailing
list's "options" file.
To use, save wherever you want, chmod +x and change your
/path/to/mailing/list/.courier like this:
| /path/to/couriermlm-wrapper msg /path/to/mailing/list
I'd like to see this feature (or equivalent) directly in couriermlm though,
with options like POST=restricted and POSTADDRESS=<regexp>
Any chance? Would a patch that implements it be welcome?
--
Flavio Stanchina
Informatica e Servizi
Trento - Italy
#!/bin/sh
# A wrapper for couriermlm that allows posting only from addresses that
# match the regular expression specified with the POSTADDRESS option.
set -e
if [ ! -d "$2" ]; then
echo "550 Requested action not taken: mailbox unavailable"
exit 78 # EX_CONFIG
fi
POSTADDRESS="$(grep '^POSTADDRESS=' "$2/options" | cut -d= -f2-)"
if ! expr "$SENDER" : "$POSTADDRESS" > /dev/null; then
echo "554 You are not allowed to post to this mailing list."
echo "Please contact <mailto:$(cat "$2/.courier-owner")> to request
authorization."
exit 77 # EX_NOPERM
fi
exec /usr/bin/couriermlm "$@"
### EOF ###