google / gmail-oauth2-tools

Tools and sample code for authenticating to Gmail with OAuth2
Apache License 2.0
420 stars 211 forks source link

sendgmail support for G Suite accounts #19

Closed wraithm closed 1 year ago

wraithm commented 4 years ago

Is there some way to get the sendgmail tool to work for a G Suite account? The tool seems to require a "@gmail.com" account. How can I get git send-email to work with a G Suite account without creating an "App-specific password"?

wraithm commented 4 years ago

@djnicolson @junyer Thoughts?

junyer commented 4 years ago

@Flameeyes filed https://github.com/google/gmail-oauth2-tools/pull/17 to enable that use case. :)

wraithm commented 4 years ago

@junyer Cool! Thanks. Just curious, why not merge this change? This seems like a fine implementation.

junyer commented 4 years ago

I can't, but @ssalbiz can. :)

BTW, as you all have seen, the code should require only trivial modifications in order to work with other domains. The hassle is with the Google Cloud console, the OAuth consent screen et cetera.

wraithm commented 4 years ago

I successfully sent email with #17 ! It works well. The OAuth consent screen worked.

junyer commented 4 years ago

Great, thank you for confirming! Do you have any suggestions for documentation tweaks that could/should be rolled into https://github.com/google/gmail-oauth2-tools/pull/17?

wraithm commented 4 years ago

The docs are clear and straightforward as is. I would definitely just add a note about the -gsuite option in the readme. So, the author of #17 should add that.

So, one minor issue I ran into: I'm using this with the patchbomb plugin for mercurial instead of git. Sadly, that plugin doesn't seem to have the ability to take arguments to its sendmail functionality, afaict. I just modified the code to take my email as the sender and the gsuite option is true by default. I think I'll send a patch to the mercurial people adding the ability to have arguments to the sendmail command.

dkruces commented 3 years ago

Any update on this? I've also tested and it worked fine with -gsuite and company domain.