Skip to content

Instantly share code, notes, and snippets.

@nikushi
Created August 30, 2012 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikushi/3522486 to your computer and use it in GitHub Desktop.
Save nikushi/3522486 to your computer and use it in GitHub Desktop.
my maildrop filter
HOME="/home/nikushi"
MAILDIR="$HOME/Maildir"
DEFAULT="$MAILDIR/"
CONF="$HOME/etc/maildrop"
logfile "$HOME/log/maildrop.log"
### turn on when debug ###
#VERBOSE=5
ME="nikushi@example.com"
if ( /^(To|CC):.*${ME}/ )
{
# 自分宛のメールは以後のMLのフィルタを通さず、
# デフォルトのdirに移動させ、すぐ読む。
to $DEFAULT
}
### filter mails to directory
if ( \
/^Subject:\s*\[hogehoge-user / || \
/^Subject:\s*\[fugafua-support/ || \
/^Subject:\s*\[abc-def / \
)
{
to "${MAILDIR}/.mydir/"
}
### to Trash
if ( \
/^Subject:\s*\[no-important / || \
/^Subject:\s*\[spam / \
)
{
to "${MAILDIR}/.Trash/"
# to "/dev/null"
}
#### all other mails are delivered to $DEFAULT ###
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment