To anyone still experiencing these issues, I have figured out a working solution.
First let me present the problem more specifically:
- I want to have both Gmail and Gchat on the native Mail and iMessages Apps on OSX.
- I am using Google's Two Factor Authentication -> this is the important part, and where the problems arise
Kanad, on the post previous to mine, states quite clearly how to generate codes for an application. The problem is that OSX tries to use the same code for both Mail and Messages, and Google doesn't like that. Sometimes keychain will accept a different password, but sometimes this won't work.
So, the solution goes by using a 'feature' from google: your e-mail address on Google is exactly the same regardless of the amount of 'dots' it has in it. E.g.: If your e-mail address is my.name@google.com, if someone sends an e-mail to myname@google.com or my.na.me@google.com (etc), they will all end up on your account.
So what I did, is setup two sepparate Google accounts on OSX's accounts setup:
- I created one with myname@google.com for e-mail, using one generated password. During setup, I only activated the e-mail.
- Then, I created a second account, using my.name@google.com (if you try to add a second account with the same address, OSX won't let you, thus why you need to create it by inserting (or removing) a dot. During this second account's creation, I only activated the Messages part, disabling the rest.
I now have both e-mail and messages running fairly well, with two-factor authentication still enabled, on my OSX installation. Rejoice!