Monthly Archives: June 2014

Offlineimap & mu4e with Google Two-Factor Authentication

Like many people, I enabled Two-Factor Authentication to my Google account. I have so much data and information there, I thought it was appropriate to protect it with this added security. I have the Google Authenticator (which I also use for Evernote and Amazon Web Services) app on my phone, so it’s usually within reach and not too much of a pain to handle.

With this, I realized that my offlineimap stopped working (which is how I update my mailbox for mu4e (Mail Utility for Emacs) because of the lack of this added security. Knowing that removing the Two Factor Authentication was not an option, I delayed using mu4e/offlineimap for a while until I could figure it out. Tonight I finally was able to check that TODO item off my list — the solution? Application specific passwords for Google accounts.

Google has a nice page explaining the process, and it was extremely simple to configure. From within Gmail, you can click on Settings/Accounts and Import, then “Other Google Account Settings”. From there just select “app passwords” from the “Security” tab, and add a new application. A password will be generated, and just copy that password into the appropriate field in your ~/.offlineimaprc file, and you’re off and running again. Emacs mail *and* added security!

Back into Emacs

I’m a huge Emacs nerd. I first used it in university computer science courses, where they would provide commands and structures for everything you needed (at first). Later on I found that it was a decent text editor, and used it for such.  Throughout my time there, that was pretty much all I had used.

Fast forward about 5 years. I got my first real IT job at a large enterprise company supporting Solaris servers. First week on the job, I logged into a server I had to make a simple change on, and ’emacs /etc/hosts”.  I received “emacs: command not found”. Oh right, the normal community doesn’t use Emacs, it’s considered pretentious, bloated, and completely unnecessary for everyday sysadmin work. So with that, I had to use vi. (At that time, vim was not even installed on Solaris by default — and might still not be.) I had never used vi in my life, so I pumped out some quick Google-fu and found the basics, insert mode, command mode, and “wq” to write (save) and quit. Got it. Now I was a vi/vim user.

Fast forward a few more years. Damian Conway, noted Perl expert/lecturer, came to my workplace to give a perl workshop. The last day of the workshop, however, he ran out of material for perl, so he proceeded to give us a “one day vim crash course” and showed us how entirely awesome vim could be. I was astounded. I wanted to increase my skills and become more efficient. Over the next couple years I added a few tweaks here and there, nothing groundbreaking, but just a couple things.

Then I met up with a couple former co-workers who were heavy Emacs users, and I started to realize what I was missing out on during all those vi/vim years. Little bit little they would discuss things like tramp, jedi, el-get, various major modes, and org-mode. I quickly got back into it. I found Sacha Chua’s Emacs blog, another heavy Emacs  user, and started following her as well, learning quite a bit more.

Today I’ve successfully set up el-get, and even handier tool, allowing easy installations of various “recipes”, including github projects, and many others. The wonder keeps growing and growing.

Not too long ago I remember thinking that there is no way I will remember all of the Emacs commands, but so far, I’ve been surprising myself over and over again. I’m glad I took the step, and that I know I’m only scratching the surface of what Emacs has to offer.