Retainability

Life's lessons expressed in UTF-8

Organizing Gmail Archives by Date

Over the weekend I found myself wanting to organize my Gmail archives into dated directories–similar to the way Thunderbird handles mail archiving.

At first I thought there is probably a gadget for this in Gmail labs, but no gadget. So I decided to roll out my own solution using filters and labels. I wasn’t really sure how to filter mail by dates so I did a quick search for filter by date in Gmail and came across a post on the My Digital Life blog, which had enough information to get me started. 


Creating The Filter

Start off by creating a new search filter in Gmail for finding all messages sent between 2 dates. For the remainder of this post I will use the dates 01/01/2009 and 01/01/2010 as examples.
Gmail, has support for 2 operators after: and before: which can be used to search for messages sent between a certain time period–dates must be in the format of yyyy/mm/dd. More information on Gmail search operators can be found here.
Enter the search string for the given date range

After entering the specified search string, if you want to test your search, click on the search button. Otherwise just click on the Create filter with this search link at the bottom of the search window to continue.  I recommend that you run a quick test to make sure the filter is working correctly.

After clicking the create filter link you need to configure the actions to take on the messages that fall under the given search. To archive and label all messages sent in 2009 check the Skip the inbox (Archive It) option, and check the Apply the label option which should be set to a label called 2009.

Set the actions the filter should take and click create filter

To apply the new filter to existing mail, check the Also apply filter to ## matching conversations box. The actual number of conversations may vary based on your search.

Once the filter has been created a new label called 2009 should show up in your list of Gmail labels. Clicking on the label will filter your inbox and show only those messages which were sent in 2009.