SHELL=/bin/bash VERBOSE=no #LOGFILE=/tmp/procmail-vt.log #LOGABSTRACT=all FROM=`formail -xFrom: | sed -e 's/ *(.*)//; s/>.*//; s/.*[:<] *//'` ########################################################### :0 * ^To:.*ml1@ * ? fgrep -qxis $FROM /home/.mailinglists/user1/list1 | /usr/local/bin/fire-mailinglist "/home/.mailinglists/user1/list1" "ML1" ########################################################### :0 * ^To:.*ml2@ * ? fgrep -qxis $FROM /home/.mailinglists/user1/list2 | /usr/local/bin/fire-mailinglist "/home/.mailinglists/user1/list2" "ML2" ########################################################### :0 | /dev/null
#!/bin/bash MAIL=$(cat /dev/stdin) FROM=$(echo "${MAIL}" | formail -xFrom: | sed -e 's/ *(.*)//; s/>.*//; s/.*[:<] *//') if [ "x${2}" != "x" ]; then MAIL=$(echo "${MAIL}" | /bin/sed -e "s/Subject: /Subject: \x5B${2}\x5D /g") fi if [ "x${1}" != "x" ]; then if [ -f "${1}" ]; then for RECP in $(cat ${1}); do MAIL=$(echo "$MAIL" | formail -I "To: ${RECP}") echo "${MAIL}" | /usr/sbin/sendmail -t -r "${FROM}" done fi fi
mail1@domain mail2@domain mail3@domain
mail3@domain mail4@domain mail5@domain
Beliebig erweiterbar. :)