Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task Complete Email #8

Open
DevMoore94 opened this issue Oct 30, 2014 · 15 comments
Open

Task Complete Email #8

DevMoore94 opened this issue Oct 30, 2014 · 15 comments

Comments

@DevMoore94
Copy link

I figured I would open an issue to discuss possible solutions to the email notification. User privacy is important and it appears the available solutions could be pretty limited. So as far as privacy, we shouldn't be able to tell who and where an email is being sent correct?

@rasbt
Copy link
Owner

rasbt commented Oct 31, 2014

Thanks for open a separate issue; it makes it simpler to keep the discussions organized! I think it should be some solution where we don't collect the email addresses of the users or information about their tasks. It sound a little bit cumbersome this way... But I think of being a user myself: I wouldn't feel comfortable if someone would be able to collect my user data e.g., when I ran certain task (especially if it is some work related stuff and a user wants to use descriptive labels).
Honestly, I have no real idea if there are some libraries where something like that has already been implemented. But I'd be happy to do some research on that (some time after Nov 13 -- have some very important deadlines on this day I have to focus on right now)

@rasbt
Copy link
Owner

rasbt commented Oct 31, 2014

And if it is not so easily doable (sorry, I haven't thought about the privacy issue initially when I had this idea) don't worry about implementing an email feature for now; it was just an idea and it is not really so important! And thanks for your general interest in improving PyPrind, I really appreciate it

@DevMoore94
Copy link
Author

No Problem at all! Just happy to be part of the project.

@rasbt
Copy link
Owner

rasbt commented Nov 1, 2014

I just saw an article that might be very helpful for achieving this task:

Sending Email using Python
http://trevorappleton.blogspot.co.uk/2014/11/sending-email-using-python.html

So, instead of providing the email in the ProgBar initialization, we can prompt for a configuration file, e.g., ProgBar(email_config='path_to_config_file')

Where the config file contains something like

SMTP_SERVER = 'smtp.gmail.com'
SMTP_PORT = 587
USERNAME = '[email protected]'
PASSWORD = 'your_gmail_password' 

However, we have to think about how to store the password. It should be at least encrypted somehow, otherwise it is really too dangerous to save the password somewhere in plain text on your computer

The only question would be how

@DevMoore94
Copy link
Author

Encryption probably wouldn't be too bad. My. Concern is that sending an email to yourself through Gmail smtp limits this to only people with a Gmail account would it not?

@rasbt
Copy link
Owner

rasbt commented Nov 2, 2014

Hey, Brandon,
this was just an example, I assume that it works with most email providers. E.g., I just tested my icloud address (with smtp.mail.me.com) and it worked too. However, I couldn't get it to work with my edu address yet. I assume that it is a little bit tricky and requires some more testing.

I have to read more about the differences between ports, SSL, TLS, and STARTTLS. But I think that we can build something that tries to send the email first via e.g., the method that is posted in the blog article and if it raises an exception, we can try those SSL or TLS things.

@DevMoore94
Copy link
Author

Wouldn't this require setting up servers for each different email provider?

@rasbt
Copy link
Owner

rasbt commented Nov 4, 2014

Right, but I think this is all something that can go in a separate config file that a user needs to setup one time like I posted above:

SMTP_SERVER = 'smtp.gmail.com'
SMTP_PORT = 587
USERNAME = '[email protected]'
PASSWORD = 'your_gmail_password' 

I just had the thought, what about a separate function in PyPrind, e.g, pyprind.setup_email(...) that the user only has to run once (unless he wants to change settings) to setup such a config file? PyPrind would then generate an encrypted file with this information maybe in its own module directory so that every time in future when a user wants to receive an email conformation, he/she can initialize the ProgBar like pyprind.ProgBar(..., email=True) -- and if it can't find the config file it will print a warning message with instructions for the user.

@DevMoore94
Copy link
Author

That sounds like a great idea! Seems to be the most logical solutions to the problem when factoring in privacy.

@rasbt
Copy link
Owner

rasbt commented Nov 7, 2014

Agree:) I think it is not only privacy but also security! I would feel very uncomfortable if I would have to store my password in plain text somewhere on my computer. Also, if I would picture myself as a user who is using someone else's tool to send "job completion" notifications, I would feel more comfortable if it is kind of anonymous.

I just stumbled across an article in a weekly Python newsletter that I thought might be relevant for encryption: "ENCRYPTING FILES WITH PYCRYPTO" http://brainacle.com/encrypting-files-with-pycrypto.html

@DevMoore94
Copy link
Author

I will have a look at this article and see if I can pull some ideas together. :)

@DevMoore94
Copy link
Author

Still not entirely sure how I would want to go about doing this.

@DevMoore94
Copy link
Author

Hey Sorry It's been a long time haha. Is this still a feature that would be useful to have?

@rasbt
Copy link
Owner

rasbt commented Feb 18, 2016

@DevMoore94 No worries! Personally, I would find such a feature very useful for certain applications. The approach using smtplib (see the link to the post above) sounds pretty reasonable to me; I haven't tested it yet, though.

@dzaytsev91
Copy link

@rasbt Hey, I read your thought about email notifications and created a pull request, I will be very please for your comments about it, this is my first open source experience, please don't be too harsh :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants