Created
August 2, 2011 22:25
-
-
Save marcelbeumer/1121390 to your computer and use it in GitHub Desktop.
maildrop/mailbot autoreply setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Global maildrop filter file | |
DEFAULT="$HOME/MailDir" | |
AUTOREPLYFILE="$HOME/AutoReply" | |
HASAUTOREPLY=`test -e $AUTOREPLYFILE && echo YES` | |
# If the Spam-Flag is set, move the mail to the Junk folder | |
if (/^X-Spam-Flag:.*YES/) | |
{ | |
exception { | |
to $DEFAULT/.Junk/ | |
} | |
} | |
else | |
{ | |
if ("$HASAUTOREPLY" =~ /YES/) | |
{ | |
if (/^To:\s*(.*)/) | |
{ | |
TOADDR=getaddr($MATCH1) | |
} | |
if (/^Subject:\s*(.*)/) | |
{ | |
SUBJECT="$MATCH1" | |
} | |
cc "| mailbot -m $AUTOREPLYFILE -d autoresponsedb -s 'AutoReply: $SUBJECT' /usr/sbin/sendmail -t -f '$TOADDR'" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment