Skip to content

Instantly share code, notes, and snippets.

@marcelbeumer
Created August 2, 2011 22:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save marcelbeumer/1121390 to your computer and use it in GitHub Desktop.
Save marcelbeumer/1121390 to your computer and use it in GitHub Desktop.
maildrop/mailbot autoreply setup
# 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