Unlearning Email

I’ve never received an urgent message online. But what if!?.

Two words that led to a decade of mindless refreshes and a bona fide email compulsion. Now overcome.

The cure took a bit of thought, a lucky break, and some amateur code wrangling. Since then I’ve actively looked forward to email two mornings a week, and spared it no thought otherwise.

The single most impactful day-to-day change I’ve made as an adult.

At university my mentor was a sweet-hearted, child-of-empire Englishman. Brian Blessed meets Santa Clause.

He once asked if I’d been ‘pig-sticking…’

“… when you’re RIDING through a forest… on a HORSE… with a SPEAR… chasing a PIG. You stab it in the back and… FLIP it over one shoulder! Y’know, pig-sticking!”

Relevant anecdote? Not at all.

At our first meeting he gifted me a bottle of wine and a page of medieval heraldry. On the back he’d handwritten everything he thought I should know about his family.

Over the next half-decade he would send me further postcards decorated with obscure family crests, semi-regularly dropping them in to my university pigeon-hole.

I’d peek in whenever I was nearby, bubbling with anticipation.

Nowadays I’m gifted bills and bullshit whenever the postmaster deems it so.

By default—by becoming an upstanding citizen—I lost control over the type of post I receive and when I see it.

The same happened to my email inbox.

It didn’t have to be this way. Bollocks to that (he eventually muttered).

For every grin a hundred unnecessary sighs.

Spam, lazy CC-ing, receipts and bills, irrelevant FYIs, and marketing chuff. Hourly attempts to find hay in a needlestack.

The pointless could go. Admin could be dumped elsewhere. Work could be useful. The rest could be a treat.

Most of that was simple enough: filters, unsubscriptions, separate—IMAP’d—email accounts for different types of message.

Client emails went to a new address, to be seen once or twice a week (foreshadowing my genius in the next section). I asked them to call me if something was time-sensitive and the cruft disappeared overnight. I cannot stress how small a deal this was.

Fixing my access addiction was harder.

I wanted to receive everything at once, at a time when I could react usefully, and then be done.

Arbitrary rules (“no email after midday,” “weekends off,” “never with friends“ etc.) would work for a few days but the addict found a way. What if!? was undefeated.

My shitty willpower was the issue.

Remove the temptation, solve the problem: A cakeless fridge adds no pounds; An unwashed dog gets no strokes; A guaranteed-empty inbox has no visitors.

Simple hypothesis, impossible execution.

Enter Google Apps Script: official tools to programmatically tweak everyday Google products. Stumbling upon a 2011 blog post from the official Gmail blog was my eureka moment.

Some fiddling later and I intercepted all incoming emails before dumping them in to a hidden folder. Inbox zero, baby.

A bit more fiddling and my Rube Goldberg machine was complete: those emails were periodically shunted in to my inbox on preset days.

Instead of an endless drip-feed I could gorge… then stop.

My work emails now arrive on Wednesdays. On Sundays I’m pleasantly surprised by words from friends and all my favourite newsletters. And once a fortnight I can skim through all my recent receipts, marketing emails, statements etc. to be sure my identity is unstolen.

A once-and-done solution to self-inflicted idiocy.

Instructions below if that’s your jam.

Install Google Apps Scripts

  1. Go to your Google Drive and sign-in.
  2. Install Google Apps Scripts: New -> More -> Connect More Apps -> Search: ‘Google Apps Scripts.’

Write the script

  1. Create a new Google Apps Script: New -> More -> Google Apps Script.
  2. Replace the boilerplate with the code below and save: File -> Save.
/**
***	Thing #1
***
***	Creates a new folder called ‘Hidden’.
***
***	Only needs to be run once.
**/

function createHiddenFolder() {
	GmailApp.createLabel('Hidden');
}

/**
***	Thing #2
***
***	Gets all hidden emails and moves ’em to your inbox.
*** 
***	Will be run based on the intervals you
***	choose in ‘Current Project Triggers.’
**/

function unhideHiddenEmails() {
  
	var hiddenLabel = GmailApp.getUserLabelByName( 'Hidden' );
	var page = hiddenLabel.getThreads();

	if( page.length > 0 ) {

		GmailApp.moveThreadsToInbox( page );
		hiddenLabel.removeFromThreads( page );
	
	}

}

Setup the script

Create a hidden folder

  1. Run ‘createHiddenFolder’: Run -> Run function -> createHiddenFolder.
  2. Give permissions…
  1. Give them! Give those delicious permissions: Advanced -> Go to [FILENAME] (unsafe) -> Allow.

Setup the timed inboxing

  1. Create your time-triggers: Edit -> Current project’s triggers -> Add triggers.
  2. Set ‘unhideHiddenEmails’ as the function, then choose your ideal frequency from the time-based trigger and interval dropdowns. Save.

Hide incoming emails

  1. Login to your Gmail account.
  2. Create a new filter: Gear icon -> Settings -> Filters and Blocked Addresses -> Create a new filter.
  3. Filter all incoming mail: Add [YOUR EMAIL ADDRESS] in the ‘To’ field -> Create a new filter.
  4. Send them to the ‘Hidden’ folder: Tick ‘Skip the Inbox (Archive it)’ and Apply the label ‘Hidden’ -> Create filter.

Hide the hidden folder from IMAP

  1. Find your IMAP settings: Gear icon -> Settings -> Labels.
  2. Untick ‘Show in IMAP’ for the ‘Hidden’ folder and set to ‘hide’ for ‘Show in label list’. Save.

If you have questions I can pretend to have answers: .