#!/bin/sh # First, eliminate duplicates with formail (part of procmail). if formail -D 65536 "$HOME"/.msgid.cache then echo duplicate chucked exit 99 fi # Return to the start of the message. rewind # Check for undesireables in the "from" field. Use DJ Bernstein's # mess822 package and also his CDB package. if cdbget "`822field from`" < ~/.badmailfrom.cdb then echo killfiled exit 99 fi # Return to the start of the message. rewind case "$EXT" in lists-*) # File the message. It is addressed to budney-lists-listname; so # $EXT2 is equal to listname. Use that as the foldername, but # reject emails when the folder does not exist. if [ -d "$HOME"/Mail/lists/"$EXT2" ] then if /usr/lib/nmh/rcvstore -nocreate +lists/"$EXT2"; then echo "$EXT2" else exit 111 fi else exit 100 fi ;; *) # Default delivery rule. /usr/lib/nmh/rcvstore +inbox && echo inbox esac # Return to the start of the message. rewind # Biff me! /usr/bin/qbiff