digitalec / deemon

Monitor specified artists for new releases
GNU General Public License v3.0
174 stars 15 forks source link

What mail providers can we use for notification mails ? #40

Closed redking974 closed 2 years ago

redking974 commented 2 years ago

Hi, I configure the config.json as below for the smtp settings : "smtp_settings": { "server": "smtp.office365.com", "port": 587, "username": "xxx@live.fr", "password": "xxx", "from_addr": "xxx@live.fr" },

When I try to receive a notification test, it results to a failure.

This is the log with verbose : `C:\WINDOWS\system32>deemon -v test 2021-10-17 14:22:43 [DEBUG] deemon.cli: deemon 2.4 2021-10-17 14:22:43 [DEBUG] deemon.cli: command: "-v test" 2021-10-17 14:22:43 [DEBUG] deemon.cli: Python 3.8.5 2021-10-17 14:22:43 [DEBUG] deemon.cli: Windows-10-xxx 2021-10-17 14:22:43 [DEBUG] deemon.cli: deemon appdata is located at C:\Users\xxx\AppData\Roaming\deemon Initializing deemon 2.4

2021-10-17 14:22:43 [DEBUG] deemon.core.config: Loading configuration, please wait... 2021-10-17 14:22:43 [DEBUG] deemon.core.db: Database version 3.2 2021-10-17 14:22:43 [DEBUG] deemon.core.config: Loaded config for profile 1 (default) 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > check_update: 7 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > debug_mode: False 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > release_channel: stable 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > query_limit: 10 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > rollback_view_limit: 10 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > prompt_duplicates: True 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > prompt_no_matches: True 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > new_releases/by_release_date: False 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > new_releases/release_max_age: 365 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > global/bitrate: FLAC 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > global/alerts: True 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > global/record_type: all 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > global/download_path: D:\Audio\deemon 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > global/email: **** 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > deemix/path: 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > deemix/arl: **** 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > smtp_settings/server: **** 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > smtp_settings/port: **** 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > smtp_settings/username: **** 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > smtp_settings/password: **** 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > smtp_settings/from_addr: **** 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > plex/base_url: 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > plex/token: 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > plex/library: 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > profile_id: 1 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > tid: 0 2021-10-17 14:22:44 [DEBUG] deemon.core.config: > profile_name: default 2021-10-17 14:22:44 [DEBUG] deemon.core.notifier: notify initialized 2021-10-17 14:22:44 [DEBUG] deemon.core.notifier: releases to notify on: None 2021-10-17 14:22:44 [DEBUG] deemon.core.notifier: Sending notification email 2021-10-17 14:22:44 [DEBUG] deemon.core.notifier: Using server: smtp.office365.com:587 Traceback (most recent call last): File "c:\program files\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\program files\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Program Files\Python38\Scripts\deemon.exe__main.py", line 7, in File "c:\program files\python38\lib\site-packages\deemon__main.py", line 5, in main cli.run() File "c:\program files\python38\lib\site-packages\click\core.py", line 1128, in call return self.main(*args, kwargs) File "c:\program files\python38\lib\site-packages\click\core.py", line 1053, in main rv = self.invoke(ctx) File "c:\program files\python38\lib\site-packages\click\core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "c:\program files\python38\lib\site-packages\click\core.py", line 1395, in invoke return ctx.invoke(self.callback, ctx.params) File "c:\program files\python38\lib\site-packages\click\core.py", line 754, in invoke return callback(*args, **kwargs) File "c:\program files\python38\lib\site-packages\deemon\cli.py", line 115, in test notification.test() File "c:\program files\python38\lib\site-packages\deemon\core\notifier.py", line 84, in test self.send(msg, test=True) File "c:\program files\python38\lib\site-packages\deemon\core\notifier.py", line 47, in send with smtplib.SMTP_SSL(config.smtp_server(), config.smtp_port(), context=context) as server: File "c:\program files\python38\lib\smtplib.py", line 1034, in init SMTP.init__(self, host, port, local_hostname, timeout, File "c:\program files\python38\lib\smtplib.py", line 253, in init (code, msg) = self.connect(host, port) File "c:\program files\python38\lib\smtplib.py", line 339, in connect self.sock = self._get_socket(host, port, self.timeout) File "c:\program files\python38\lib\smtplib.py", line 1042, in _get_socket new_socket = self.context.wrap_socket(new_socket, File "c:\program files\python38\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "c:\program files\python38\lib\ssl.py", line 1040, in _create self.do_handshake() File "c:\program files\python38\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [WinError 10054] Une connexion existante a dû être fermée par l’hôte distant`

Do I have a solution about this issue ?

Regards

digitalec commented 2 years ago

According to Microsoft, it looks like the SMTP server for Outlook/Live/Office 365 is smtp-mail.outlook.com.

Also, if you use 2FA you'll need to create an app password to connect.

deemon simply connects to an SMTP server and does not need to support an individual service, any service will work.

redking974 commented 2 years ago

Thanks for the reply. So I change the server as you mention and it got me another error

Traceback (most recent call last): File "c:\program files\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\program files\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Program Files\Python38\Scripts\deemon.exe__main.py", line 4, in File "c:\program files\python38\lib\site-packages\deemon\main.py", line 1, in from deemon import cli File "c:\program files\python38\lib\site-packages\deemon\cli.py", line 11, in from deemon.cmd import download, rollback, backup File "c:\program files\python38\lib\site-packages\deemon\cmd\download.py", line 11, in from deemon.core import dmi File "c:\program files\python38\lib\site-packages\deemon\core\dmi.py", line 5, in import deemix.utils.localpaths as localpaths File "c:\program files\python38\lib\site-packages\deemix\utils\init.py", line 2, in from deezer import TrackFormats ImportError: cannot import name 'TrackFormats' from 'deezer' (c:\program files\python38\lib\site-packages\deezer\init__.py)

I guess it doesn't related to the smtp server. But I fill the config.json as below which seems correct : "check_update": 7, "debug_mode": false, "release_channel": "stable", "query_limit": 10, "rollback_view_limit": 10, "prompt_duplicates": true, "prompt_no_matches": true, "new_releases": { "by_release_date": false, "release_max_age": 365 }, "global": { "bitrate": "FLAC", "alerts": true, "record_type": "all", "download_path": "D:\Audio\deemon", "email": "xxx+deemon@gmail.com" },

digitalec commented 2 years ago

That issue is related to the deezer-py module. I would recommend reinstalling it by running pip install --force-reinstall deezer-py. Closing issue as this is not an issue. If you need help getting things going, feel free to reply here or jump over to the Discord