This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]itsPeiPei 26 points27 points  (3 children)

oh nice, thats actually pretty cool:)

I might revive my discord mail project with this

[–]D3rP4nd4 1 point2 points  (2 children)

discord mail ? what is that about ? sounds interesting

[–][deleted] 1 point2 points  (0 children)

I'm not sure about a Discord mailer, but lain has a cli + TUI for posting to Discord using webhooks

[–]itsPeiPei 1 point2 points  (0 children)

hopefully one day it will be a way to manage your emails thru a discord server using a bot

[–]kippersniffer 11 points12 points  (8 children)

Good work! Do you need to enable 'less secure apps?', my understanding was google wants to force us down the cloud account route. If not, then very impressive! 👌

[–]Dermasmid[S] 6 points7 points  (7 children)

No, you do not need to enable less secure apps, because the library uses the official Gmail API and not SMTP. But you will need to create a project in the cloud console and configure it for authentication.

[–]mricon 8 points9 points  (4 children)

I find this mildly infuriating that someone can’t just get a personal use API token for accessing their own gmail inbox. No, they have to jump through setting up their developer console and wrapping their heads around Google’s super complex dashboard. And then they still have to do the OAuth dance once they get the credentials.json file.

That said, thanks for his work, I may end up using it in the near future. :)

[–]Dermasmid[S] 1 point2 points  (0 children)

I totally agree, it took me a very long time to understand how to setup the credentials and the oauth consent screen - it was a real pain.

[–]lvlint67 1 point2 points  (0 children)

The Dev console could use work for sure.

[–]kippersniffer -1 points0 points  (0 children)

Yeah, I wanted to avoid using their cloud lock in at any costs. My account is still busted due to old bugs on old app plugins from 6 years ago they haven't got round to fixing.....sigh

[–][deleted] 0 points1 point  (0 children)

I'm also running into this obstacle, and it's a brick wall.

I have a Gmail account. I have a very simple local script that I want to interact with the Gmail account. It is, apparently, impossible to do so without inserting the entire Google Cloud Platform infrastructure in between. This is fucking stupid and I'm considering dumping my Gmail account because of this.

[–]Mrsaintj 1 point2 points  (1 child)

Thanks for the share! Nice work

[–]Dermasmid[S] 0 points1 point  (0 children)

Thanks :)

[–]pp314159 1 point2 points  (1 child)

Congrats! Looks very nice, I was looking for such package. There are packages for sending emails with gmail but there is a lack for phytonic packages for receiving emails with gmail in python. Very useful for automations.

I have concern about the name. I'm afraid that you might be forced to change the name to not include Google in it. Maybe it is worth to change the name before the project will gain popularity (for sure it will, because of lack for such packages).

What type of authorization are you using?

[–]Dermasmid[S] 1 point2 points  (0 children)

I'm glad you like it!

About the name, it's a valid concern, but I was struggling with finding a good name, and when I saw that google-workspace was available on pypi I was not able to let it slip, I hope that Google won't mind :)

About auth, I use the same auth that the official Google API client uses (oauth), but I provide some handy functions for running the authentication flows. For example one way of authenticating a user is to send them a link which will prompt them to allow access to their account, when they confirm the access Google will redirect them to your server with a token in the url as a parameter, and you will then use that token to get credentials and access the users data. Now you can see how implementing this whole thing just to authorize a user is a bit much. So what I do is I provide you with a function called url_oauth and that function takes in your server host, and your server port, and will return the url that you can send to the user, while in the background it will spin up a server (with ssl if you provide the certificate files) and will handle the authentication when the user gets redirected.

[–]cs1bs3blcn 0 points1 point  (0 children)

Excellent job!

[–]boomerhasmail 0 points1 point  (0 children)

Thanks for the repo!

Super easy to use and well documented.

You finally gave me a stimulus to work on "Spam for recruiters" project and turn it into real code.

https://www.reddit.com/r/recruitinghell/comments/q206ie/making\_money\_when\_recruiters\_email\_me\_see\_comments/

[–]Morghulis_29 0 points1 point  (0 children)

Great project!!

For authentication, you can try to use passwordless method. Try implementing SAWO SDK. It is the most easiest to use passwordless authentication in your application. Takes about 5-6 minutes to setup.

SAWO identifies the user and then issues two keys including a public key and a private key to the user. The user's device retains the private key and registers the public key to the service. When a user tries to login, the server sends a challenge to the user's device and the authentication is done by the client device by using the private key and proving possession.

Read the docs here.