The Mail binding sendMail is working for me, but, without two-factor. So I’m going to set that up, but I have a couple questions about what @rlkoshak says here.
When you set up the two-factor on gmail they instruct to select the app and the device to generate the app password. I have not attempted this yet, does openhab show up and what device are they referring to? (and if I read this post right, the app password generated simply replaces the email address in the user name field in the Thing definition?)
Where is the “SHOW MORE” that has the Server port? and is the field in the Thing definition: serverport=587? I didn’t find any reference to the serever port in the Mail binding wiki…maybe I’m confused…nothing new there.
This is all completely separate. That lets you use an app like Google Authenticator to generate a number every twenty seconds that is used as the second factor.
The app is what Google app you want to allow this password access to. The device is just some unique name so when you come back later you can tell which password is assigned to which device.
You use the generated password as the password to log in. You still need to use your email for the username.
No. openHAB doesn’t appear anywhere on Google. Anything that has the generated password can access the selected Google apps. Choose mail as the app, use the generated String as the password on your mail Thing, and openHAB will be able to access your Gmail.
Again, the app you select is what Google app/service can be accessed with that password. Not what app or service is doing the accessing.
You cannot do 2 factor log in from openHAB. You must bypass 2 factor by generating an app password.