HowTo: Use Multiple Addresses in Gmail Filters
August 25, 2007
Gmail has incredible filtering, and I forward most of my older addresses to it to take advantage of its spam filtering capabilities before pulling the messages down to my box. Another cool feature is having the ability to tag messages based on some criteria, such as based on who sent a message. The only thing lacking is the user interface for creating these filters, because it doesn’t make readily obvious how to incorporate multiple addresses into one filter.
I’ve incorporated the knowledge gleamed from a google search on the topic into a Ruby script that takes multiple addresses in and returns a filter string that will work with gmail filters. I hope someone else finds it useful! (download)
#!/usr/bin/ruby -w
#
# Gmail supports filters, but the interface provided doesn't make it appear
# to support filtering multiple addresses at the same time. It does,
# and given multiple addresses, this script will return a filter string
# that matches multiple sources.
#
# Author: Robert Peaslee
#
if $*.length < 3
p "Usage: filters.rb ..."
exit( 1 )
end
case $*[0]
when "from"
# Get rid of first element
$*.shift
string = "from:("
$*.each { |addr|
string << "#{addr}) OR from:("
}
string.slice!( -8, string.length )
p "Copy this into the filter:"
p "#{string}"
exit( 0 )
when "to"
# Get rid of first element
$*.shift
string = "to:("
$*.each { |addr|
string << "#{addr}) OR to:("
}
string.slice!( -8, string.length )
p "Copy this into the filter:"
p "#{string}"
exit( 0 )
else
p "Please supply either from or to as the first argument."
exit( 1 )
end
Mapping Traffic With Google
April 24, 2007
Being very used to checking out traffic.com before I leave work every day (sometimes it pays to sit at my desk rather than in traffic), I was happy to see google maps has incorporated traffic statistics on a route you specify (just click the ‘traffic’ button on a map!). While traffic.com will remain my pre- and post-work commute check due its detailed statistics, google maps just won the bid for any one-time or quick trip checks where I don’t necessarily want to do an exit-by-exit route analysis at traffic.com.
Gmail Address Filtering
September 24, 2006
Note: This post has been updated.
