Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #105919 > unrolled thread

Sending gmail with no clear password

Started byzljubisicmob@gmail.com
First post2016-03-28 12:55 -0700
Last post2016-03-28 21:41 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Sending gmail with no clear password zljubisicmob@gmail.com - 2016-03-28 12:55 -0700
    Re: Sending gmail with no clear password Erik <python@lucidity.plus.com> - 2016-03-28 21:41 +0100

#105919 — Sending gmail with no clear password

Fromzljubisicmob@gmail.com
Date2016-03-28 12:55 -0700
SubjectSending gmail with no clear password
Message-ID<fca9623b-8182-4f18-a2a1-a6dce2170a84@googlegroups.com>
Hi,

I have a python3 script that runs 24/7 on linux (raspberry pi) server. 
It would be very nice for the script to be able to send an email message about certain statuses.

As the linux server is headless, I don't have an option to key in the password while starting the script.
Furthermore, from time to time I restart the server remotely, so password should be somewhere in the system but kept more secure than hardcoded in the python script.

I understand that I can send email by using let's say procedure from the https://rajivpandit.wordpress.com/2013/09/19/how-to-send-email-by-python/

On the link above there are two approaches. One with no need for any authentication or password, but that approach doesn't work.
It is written for python 2 but that is what I need.

What are my options?

Regards.

[toc] | [next] | [standalone]


#105921

FromErik <python@lucidity.plus.com>
Date2016-03-28 21:41 +0100
Message-ID<mailman.112.1459197720.28225.python-list@python.org>
In reply to#105919
Hi. It's hard to understand what your question is.

On 28/03/16 20:55, zljubisicmob@gmail.com wrote:
 > I have a python3 script that runs 24/7 on linux (raspberry pi)
 > server. It would be very nice for the script to be able to send an
 > email message about certain statuses.

Reading between the lines, am I correct in stating that:

1) You preferably want to send an email with no authentication at all.
2) If authentication is /required/ by the server you are contacting then 
you don't want the password to be stored in plain text.
3) The link you pasted does what you want (with no authentication), but 
it doesn't work in Python 3.

> What are my options?

If I have understood you correctly, then the obvious thing is to convert 
the code in the link so that it works in Python 3.

If you can't do that and you need to use authentication, then there's 
only so much you can do to protect your password if you don't want to 
type it in.

Why can't the password be stored in plain text? Who are you trying to 
secure it from?

I suspect that the answer is that you can /obscure/ or /obfuscate/ the 
password (i.e., make it difficult to determine - encrypt it using some 
unique key that's obtained from the server's H/W somehow), but it would 
be very hard to actually /secure/ it from anyone with access to your 
Rpi. If your script can determine the password in plain text 
automatically (without some sort of external input), then so can anyone 
who has logged into the device with the appropriate permissions - if 
only by copying the script and making it display the password rather 
than send it to the server.

E.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web