urlwatch icon indicating copy to clipboard operation
urlwatch copied to clipboard

How to configure Email Report using google SMTP

Open engowen opened this issue 8 years ago • 4 comments

Hi,

Does the email report support google smtp? I'm using the latest version on my Mac. In the urlwatch.yaml I'd the following setting where i'd added user and password:

email: enabled: true from: '' html: false method: smtp sendmail: path: sendmail smtp: host: smtp.gmail.com user: [email protected] password: mypassword keyring: true port: 465 starttls: true

however on running urlwatch I get the following error:

urlwatch 2.7, Copyright 2008-2016 Thomas Perl Website: http://thp.io/2008/urlwatch/ watched 1 URLs in 0 seconds Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/bin/urlwatch", line 106, in urlwatch_command.run() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urlwatch/command.py", line 167, in run self.urlwatcher.close() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urlwatch/main.py", line 96, in close self.report.finish() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urlwatch/handler.py", line 128, in finish ReporterBase.submit_all(self, self.job_states, duration) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urlwatch/reporters.py", line 92, in submit_all subclass(report, cfg, job_states, duration).submit() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urlwatch/reporters.py", line 366, in submit mailer.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urlwatch/mailer.py", line 83, in send s = smtplib.SMTP(self.smtp_server, self.smtp_port) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/smtplib.py", line 251, in init (code, msg) = self.connect(host, port) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/smtplib.py", line 338, in connect (code, msg) = self.getreply() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/smtplib.py", line 394, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed") smtplib.SMTPServerDisconnected: Connection unexpectedly closed

Thanks, Brian

engowen avatar Jan 28 '18 10:01 engowen

I also struggled with configuring email notifications and was able to solve the problem using the example/instructions posted in response to a different but related issue (found here: https://github.com/thp/urlwatch/issues/158 ). Perhaps give that a try and see if it solves the problem.

jstnmchl avatar Feb 06 '18 05:02 jstnmchl

Documented now (see README.md).

thp avatar Jun 03 '18 12:06 thp

It would be great to add urlwatch --test-smtp feature to check if it is working correctly.

adrianmihalko avatar Jan 01 '19 01:01 adrianmihalko

... how true!

foice avatar Apr 13 '19 01:04 foice