leiweibau / Pi.Alert

Scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. It also warns if a "always connected" device disconnects. In addition, it is possible to check web services for availability. For this purpose HTTP status codes and the response time of the service are evaluated.
https://leiweibau.net
GNU General Public License v3.0
342 stars 25 forks source link

No messages are sent after the update #236

Closed Interfud closed 6 months ago

Interfud commented 6 months ago

Test Reporting... Sending report by email... Traceback (most recent call last): File "/root/pialert/back/pialert_reporting_test.py", line 308, in sys.exit(main()) ^^^^^^ File "/root/pialert/back/pialert_reporting_test.py", line 91, in main res = sending_notifications_test('noti_Timerstop') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/pialert/back/pialert_reporting_test.py", line 128, in sending_notifications_test send_email (notiMessage, notiMessage) File "/root/pialert/back/pialert_reporting_test.py", line 274, in send_email smtp_connection.login (SMTP_USER, escaped_password) File "/usr/lib/python3.11/smtplib.py", line 750, in login raise last_exception File "/usr/lib/python3.11/smtplib.py", line 739, in login (code, resp) = self.auth( ^^^^^^^^^^ File "/usr/lib/python3.11/smtplib.py", line 662, in auth raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (534, b'5.7.9 Application-specific password required. For more information, go to\n5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor w11-20020a056512098b00b0050e8ea87dcesm1401366lft.169 - gsmtp')

leiweibau commented 6 months ago

You are right. I have just set up a Gmail account as a test and was confronted with the same error. The error message also refers to the problem.

Application-specific password required. 
For more information, go to https://support.google.com/mail/?p=InvalidSecondFactor

I followed the instructions and created an app-specific password and saved it in the Pi.Alert Config. After that everything worked as it should. Unfortunately, I cannot explain why this effect occurred with the update.

Interfud commented 6 months ago

How to set this up in the config? Thanks!

leiweibau commented 6 months ago

Part one:

Create & use app passwords Important: To create an app password, you need 2-Step Verification on your Google Account.

If you use 2-Step-Verification and get a "password incorrect" error when you sign in, you can try to use an app password.

Part two:

Set password in Pi.Alert

Interfud commented 6 months ago

Thanks!