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!