I want to be able to retrieve emails from a gmail inbox but I cant find a way to properly authenticate in a server environment. Traditional authentication uses this: https://developers.google.com/identity/protocols/oauth2 however I don't have access to a web browser with javascript within a server environment so I cant authenticate. A service account wont work because I wont be able to access inbox of my main email address through it. Thanks.