-1

Premise: I am a beginner in search for an easy way to send bug reports from users over sea.

I've made a script for some friends that are living on the other side of the sea (US - EUROPE)... I will like to gather automatic bug reports whenever they happen. So my first idea was to send myself an email with the smtplib module. It works fine when testing home, but as soon as the sender "sends", my email provider (gmail) blocks the connection because of course, its from an "unknown device". I've already enabled "Allow less secure apps" as someone suggested but with no avail.

What I am searching its a simple way of dealing with this.

Yes I could make the script to ignore the error if the email its not being sent, and then go into my google account and enable those devices so at least it will work from the second run.. But it doesn't seem what a programmer would do in this case. I am learning so a solution withing the language is what I am after.

A different provider that has no restriction its also a good start but I tried Yahoo, Live, Yandex but I couldn't make them work. Are there any?

So my question is: how others do? what is the best solution for some one like me?

I've read about sentry or other error/bug tracking but its obviously way too much for want I need

martineau
  • 119,623
  • 25
  • 170
  • 301
Virgil Sisoe
  • 195
  • 1
  • 12

2 Answers2

0

You should certainly not incorporate e.g. Gmail credentials in the code that is remotely executed on devices you do not control, given I understand correctly the Gmail less secure device issue happens as every "user" is running this code and using your credentials. This holds true for any other provider.

Now this won't exactly be simple but one way to go about it would be to create a server side API endpoint that can accept HTTP(s) or any other protocol requests that then will authenticate in a little more secure way on the server side with Gmail.

The concept for emails is: Bug > Python Script > API call > Email

This could be implemented using Python on the API side (Flask e.g.) using an AWS Lambda Function with Amazon API Gateway, but again that is something to get through and understand by itself which will take a good chunk of time. You need to touch a lot of concepts, like auth tokens to make this really secure.

Could you elaborate a little on where the code needs to run and if you are willing to try AWS or any other cloud provider, or would have access to an internet connected server ? This makes it easier to provide you with a full example on the solution in a hackish way while I would highlight the problems you could face on the security side.

d parolin
  • 194
  • 6
  • thank you for the interest but I rather do something that I understand.. I don't want to just copy and paste. While I will like to know about it some day, this goes way above my level right now. For the email credential you are obviously right. I've made e single use account just for this purpose so yea I believe no harm could be done even if some one would find the credentials... but I am no cyber security expert so who knows. – Virgil Sisoe Jun 09 '18 at 18:32
0

I understand that this is not the way to go but as for my needs and my level of experience it works for me!

Yandex allows you to send email from different ip so Yandex is the way to go. What I was doing wrong in the first place was to use the wrong port (587 instead of 465)

Virgil Sisoe
  • 195
  • 1
  • 12