Productivity: Use Outlook Search Folders
I’ve been an emacs user since 1991, and from 1993 until 2019-06-10 I
used Emacs VM mode to read email. I
still use it for my personal email, but I’ve given up using it for
Microsoft mail and instead started using Outlook. The most essential
feature I need is what VM mode called Virtual
Folders:
"Virtual folders contain messages from one or more real folders (see
ViewMailFolders) with various filters applied to select which messages
to include."
My favorite aspect of this feature was that you could use
regular expressions to specify the filters.
I used the feature to craft a 7 level, prioritized new mail reading process in line with “First things first” techniques espoused by Steven Covey. When I would do my main email session of the day, I’d go through the 7 virtual folders to make sure I acted on the important emails first.
Outlook has a similar feature, called “Search Folders”. The only shortcoming appears to be that you cannot use regular expressions. That and the fact that Emacs VM had the feature in 1993, while Outlook for Windows 3.1 was only in its very early version at that point.
This blog post shows how to approximate the VM Virtual Folders feature with Outlook Search Folders.
The Emacs VM side.
The “Search Folders” help page shows how to do it, but my secret sauce is my ordered list of virtual folders, prevented in abbreviated form here. I have used the “Search Folders” feature to approximate what I had with VM. After this bunch of lisp, I’ll show how I created search folders for some of these virtual folders.
- (setq vm-virtual-folder-alist
- '(
- ("1-urgent"
- (("/home/ejburns/fmail/INBOX")
- (or (subject ".*[uU][rR][gG][eE][nN][tT].*")
- (subject ".*[tT][iI][mM][eE].[sS][eE][nN][sS][iI][tT][iI][vV][eE].*")
- (subject ".*[vV][oO][iI][cC][eE][mM][aA][iI][lL].*[fF][rR][oO][mM].*")
- (subject ".*[aA][cC][tT][iI][oO][nN].*")
- (subject ".*[pP][lL][eE][aA][sS][eE].*[rR][eE][pP][lL][yY]")
- (subject ".*[pP][lL][eE][aA][sS][eE].*[rR][eE][sS][pP][oO][nN][dD].*")
- (subject ".*[pP][lL][eE][aA][sS][eE].*[rR][eE][aA][dD].*")
- (subject ".*[mM][aA][rR][kK].*[cC][aA][lL][eE][nN][dD][aA][rR].*")
- )
- )
- )
- ("2-important-people-a"
- (("/home/ejburns/fmail/INBOX" "/home/ejburns/fmail/.mail/issuetracker")
- (or (author ".*[pP][rR][oO][dD][uU][cC][tT] [LL][iI][fF][eE][cC][yY][cC][lL][eE] [SS][uU][iI][tT][eE].*")
- (author "Larry Ellison")
- )
- ))
- ("2-important-people-b"
- (("/home/ejburns/fmail/INBOX" "/home/ejburns/fmail/.mail/issuetracker")
- (or
- (author "Manfred Riem")
- (subject ".*[bB][eE][aA][nN].*[vV][aA][lL][iI][dD][aA][tT].*")
- (subject ".*[oO][iI][mM].*")
- (header "X-folder: issuetracker")
- )
- ))
- ("3-ejburns"
- (("/home/ejburns/fmail/INBOX")
- (or (recipient "ed.burns@sun.com")
- (recipient "edburns@java.net"))
- )
- )
- ("4-dev-lists-primary"
- (("/home/ejburns/fmail/.mail/dev-lists" "/home/ejburns/fmail/.mail/jsr369-experts" "/home/ejburns/fmail/.mail/jsr372-experts" "/home/ejburns/fmail/.mail/jsr362-experts")
- (or
- (recipient ".*jsr372-experts@javaserverfaces-spec-public.*")
- (recipient ".*jsr369-experts@servlet-spec.*")
- (recipient ".*dev@javaserverfaces.*")
- (recipient ".*dev@facelets.*")
- (recipient ".*edburns@java.net.*")
- (recipient ".*nb68-jsf2-dev.*")
- (recipient ".*glassfish-guerilla.*")
- )
- )
- )
- ("5-dev-lists-secondary"
- (("/home/ejburns/fmail/.mail/dev-lists" "/home/ejburns/fmail/.mail/public_cloud_info_ww_grp")
- (or (recipient ".*jsr-303-eg.*")
- (recipient ".*dev@glassfish.*")
- (recipient ".*jsr-ri-integration-list.*")
- (recipient ".*ee6jboss-int.*")
- (recipient ".*public_cloud_info_ww_grp.*")
- (recipient ".*eearch@sun.com.*")
- (recipient ".*[jJ][aA][vV][aA][eE][eE]_[aA][rR][cC][hH][iI][tT][eE][cC][tT][uU][rR][eE]_[wW][wW].*")
- (recipient ".*el-next.*")
- (recipient ".*webtier-tech@sun.com.*")
- )
- )
- )
- ("6-user-lists"
- (("/home/ejburns/fmail/.mail/user-lists")
- (or
- (recipient ".*webtier@glassfish.*")
- (and
- (recipient ".*users@glassfish.*")
- (subject ".*[jJ][sS][fF].*")
- )
- (and
- (recipient ".*users@glassfish.*")
- (subject ".*[fF][aA][cC][eE][sS].*")
- )
- )
- )
- )
- ("7-lastMonth"
- (("/home/ejburns/fmail/INBOX")
- (and
- (not (older-than 30))
- (not (deleted))
- )
- )
- )
- ("8-lastWeek"
- (("/home/ejburns/fmail/INBOX")
- (and
- (not (older-than 7))
- (not (deleted))
- )
- )
- )
- ("9-yesterday"
- (("/home/ejburns/fmail/INBOX")
- (and
- (not (older-than 1))
- (not (deleted))
- )
- )
- )
- ("$-jsr-314-open"
- (("/home/ejburns/fmail/.mail/dev-lists")
- (or (recipient ".*jsr-314-comments.*")
- (recipient ".*jsr-314-open.*")
- (recipient ".*jsr-314-eg.*")
- )
- )
- )
- ("non-ejburns-issues"
- (("/home/ejburns/fmail/.mail/issuetracker")
- (not
- (and
- (text ".*Assignee: ejburns.*")
- (text ".*Assignee: ejburns.*")
- )
- )
- )
- )
- ("lastYear"
- (("/home/ejburns/fmail/INBOX")
- (and
- (sent-after "31 Dec 2016")
- (sent-before "01 Jan 2018")
- )
- )
- )
- ("myfaces"
- (("/home/ejburns/fmail/INBOX")
- (or (recipient ".*myfaces.*")
- )
- )
- )
- ("webtier-alignment"
- (("/home/ejburns/fmail/INBOX")
- (or (recipient ".*webtier-alignment.*")
- )
- )
- )
- ("jsr-252-comments"
- (("/home/ejburns/fmail/INBOX")
- (or (recipient ".*jsr-252-comments.*")
- )
- )
- )
- ("jsr-154-eg"
- (("/home/ejburns/fmail/INBOX")
- (or (recipient ".*servlet-spec-eg.*")
- )
- )
- )
- ("jsr-303-eg"
- (("/home/ejburns/fmail/INBOX")
- (recipient "[jJ][sS][rR]-303-[eE][gG]@[jJ][cC][pP].[oO][rR][gG]")
- ))
- ("out-of-office"
- (("/home/ejburns/fmail/INBOX")
- (or (subject ".*[oO][uU][tT].*[oO][fF].*[oO][fF][fF][iI][cC][eE].*")
- (subject ".*[wW][fF][hH].*")
- )
- )
- )
- ("hudson"
- (("/home/ejburns/fmail/INBOX")
- (or (subject ".*[hH][uU][dD][sS][oO][nN].*")
- (subject ".*[jJ][eE][nN][kK][iI][nN][sS].*")
- (author ".*[hH][uU][dD][sS][oO][nN].*")
- (author ".*[jJ][eE][nN][kK][iI][nN][sS].*")
- (author ".*[oO][dD][xX][ ][gG][iI][tT][lL][aA][bB].*")
- )
- )
- )
- ("bugdb"
- (("/home/ejburns/fmail/INBOX")
- (or (author ".*[bB][uU][gG][dD][bB].*")
- )
- )
- )
- ("github"
- (("/home/ejburns/fmail/INBOX")
- (or (author ".*[nN][oO][tT][iI][fF][iI][cC][aA][tT][iI][oO][nN][sS]@[gG][iI][tT][hH][uU][bB].[cC][oO][mM].*")
- )
- )
- )
- ("confluence"
- (("/home/ejburns/fmail/INBOX")
- (or (author ".*[cC][oO][nN][fF][lL][uU][eE][nN][cC][eE].*")
- )
- )
- )
- ("git"
- (("/home/ejburns/fmail/INBOX")
- (or (author ".*[eE][sS][eE] [sS][uU][pP][pP][oO][rR][tT].*")
- )
- )
- )
- ("commits"
- (("/home/ejburns/fmail/INBOX")
- (or (recipient ".*commits@.*java.net.*")
- (recipient ".*cvs@.*java.net.*")
- )
- )
- )
- ("jira"
- (("/home/ejburns/fmail/INBOX")
- (or (author ".*[jJ][iI][rR][aA].*")
- (subject "ODCS:.*")
- (subject ".*[wW][eE][bB][lL][oO][gG][iI][cC].*")
- )
- )
- )
- ("calendar"
- (("/home/ejburns/fmail/INBOX")
- (or (subject ".*[mM][eE][eE][tT][iI][nN][gG] [iI][nN][vV][iI][tT][eE].*")
- (subject ".*[MM][eE][eE][tT][iI][nN][gG] [WW][iI][tT][hH][dD][rR][aA][wW][nN].*")
- (subject ".*[MM][eE][eE][tT][iI][nN][gG] [UU][pP][dD][aA][tT][eE][dD].*")
- )
- )
- )
- ("jenkins"
- (("/home/ejburns/fmail/INBOX")
- (or (author ".*[jJ][eE][nN][kK][iI][nN][sS].*")
- )
- )
- )
- )
- )
I only use the “numbered” virtual folders in my daily email scan. But if you have an enormous volume of incoming mail, as I did when I was the spec lead of several JSRs at the same time, the other ones were very helpful. I will say that since the advent of tools like Slack and Microsoft Teams, the volume of email is less.
The Outlook Side
Create your First Search Folder: 1-urgent
Click the “Folder” menu, then the “New Search Folder” button, as shown next.
In the “New Search Folder” dialog that appears, scroll the content of the “Select a Search Folder” pane down to the bottom and select “Create a custom Search Folder”. Click “Choose…”.
In the “Name” field, type 1-urgent
.
Click the “Browse…” button just beneath the “Mail from these folders will be included in this Search Folder: heading. Uncheck the ridiculously tiny little checkbox next to your account name and check the ridiculously tiny little checkbox next to “Inbox”. Make sure “Search subfolders” is checked, as shown next.
This is important, otherwise you’ll see “Deleted”, “Sent”, “Drafts”, “Junk” and other undesirable nonsense in your Search Folders. Click “OK”.
Click “Criteria”. Selct the “More Choices” Tab. Check the checkbox next to “Only items that are:” and change the value to “unread”. If you neglect this step you’ll see things you’ve already seen, which defeats the purpose of the exercise.
Select the “Advanced” tab. Drop down the “Field”
menu, mouse over “Frequently-used fields”, and mouse over to “Subject”.
Click on “Subject”. Leave the “Condition” as contains
. In the value
enter “urgent”. Click “Add to List”.
Do this again and again for lines 6 - 13 in the lisp above. The matches
are case-insensitive by default, and this thing doesn’t appear to accept
regexp anyway, so that’s why you don’t need the goofy looking
.*[uU][rR][gG][eE][nN][tT].*
type syntax. However, as you’ll see,
this is a lot more clicking than just writing some simple regexps. I’d
rather the regexps.
After adding all the subject variants click “OK”, then click “OK” again. This will cause the “1-urgent” Search folder to appear in the “Search Folders” section on the left navigation, as shown next.
I like to add the Search Folders to my favorites. To do this, right click on the Search Folder and choose “Add to Favorites”.
Create Your Second Search Folder: 2-important-people-a
Right click the “Search Folders” heading in the left nav bar and choose “New Search Folder”. Type the name “2-important-people-a” and do the “Browse…” ridiculously tiny little checkbox trick again.
Click “Criteria”. Select the “Advanced” tab. Drop down the “Field”
menu, mouse over “Address fields”, and mouse over to “From”. Click on
“From”. Leave the “Condition” as contains
. In the value enter the
name of the important person. Click “Add to List”.
After adding all the important people, click “OK”, then click “OK” again. This will cause the “2-important-people-a” Search folder to appear in the “Search Folders” section on the left navigation. Add this to the favorites as well.
Create Your Third Search Folder: 2-important-people-b
This is just the same as the preceding step, but for people that are not
as important to you as important-people-a
. I find having two levels
of important people is enough for me, but YMMV. I tend to put bosses
and their bosses in the “a” category and my important collaborators in
the “b” category. Everyone else falls into the timed categories I’ll
show later.
Create Your Fourth Search Folder: 3-<your name>
This folder is for messages sent directly to you, not messages that you receive by virtue of being on a mailing list.
Create this using the steps as for the preceding Search Folders, but
when you get to the “Criteria” step, it’s different. In the “Messages”
tab, In the text field next to “Sent To…”, fill in a semicolon
separated list of the identifiers for your email address. In my case, I
put Ed Burns <Edward.Burns@microsoft.com>; Edward Burns;
edburns@microsoft.com; edward.burns@microsoft.com
because these are all
I can be reached.
Create the “date based” Search Folders: 7-lastMonth, 8-lastWeek, 9-yesterday
Create these folders in a similar fashion as above, but when you get to criteria selection, Drop down the “Field” menu, mouse over “Date/Time fields”, and mouse over to “Sent”. Click on “Sent”. Change the value of “Condition” to “Last Month”. Click “Add to List”. Click “OK” and “OK”.
Create Search Folders for “Last Week” and “Yesterday” in a similar manner.
Summary
One of the rockstar programmer skills I found is “mastery of tools”. All of us, not just programmers, need to have mastery of email. I hope this one weird trick helps you save time on email.