Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: (apprise) E-mail notifications broken to email servers by IP address #2324

Closed
kroese opened this issue Apr 19, 2024 · 6 comments · Fixed by #2363
Closed

[Bug]: (apprise) E-mail notifications broken to email servers by IP address #2324

kroese opened this issue Apr 19, 2024 · 6 comments · Fixed by #2363
Assignees
Labels
bug Something isn't working Notifications systems Development of notifications of changes upstream-bug issue with library - not directly with changedetection

Comments

@kroese
Copy link

kroese commented Apr 19, 2024

Since very recently the e-mail (SMTP) notifications do not function anymore. I think this was introduced somewhere between v0.45.18 and v0.45.20.

Also I do not see any button anymore to send a test notification, making the problem harder to debug (but that might be a separate bug).

The error I get is:

SENDING - null
smtplib.SMTPServerDisconnected: please run connect() first
raise SMTPServerDisconnected('please run connect() first')
File "/usr/local/lib/python3.10/smtplib.py", line 365, in send
self.send(f'{s}{CRLF}')
File "/usr/local/lib/python3.10/smtplib.py", line 378, in putcmd
self.putcmd(cmd, args)
File "/usr/local/lib/python3.10/smtplib.py", line 431, in docmd
res = self.docmd("quit")
File "/usr/local/lib/python3.10/smtplib.py", line 1004, in quit
socket.quit()
File "/usr/local/apprise/plugins/NotifyEmail.py", line 921, in submit
return self.submit(messages)
File "/usr/local/apprise/plugins/NotifyEmail.py", line 855, in send
the_calls = [self.send(**kwargs2) for kwargs2 in send_calls]
File "/usr/local/apprise/plugins/NotifyBase.py", line 382, in <listcomp>
the_calls = [self.send(**kwargs2) for kwargs2 in send_calls]
File "/usr/local/apprise/plugins/NotifyBase.py", line 382, in notify
result = server.notify(**kwargs)
File "/usr/local/apprise/Apprise.py", line 582, in _notify_sequential
Traceback (most recent call last):
2024-04-19 15:44:13,815 - ERROR - Unhandled Notification Exception
2024-04-19 15:44:13,815 - WARNING - Sending email to "alerts@example.com" failed. Reason: please run connect() first
2024-04-19 15:44:13,814 - DEBUG - Connecting to remote SMTP server...
2024-04-19 15:44:13,811 - DEBUG - Delivery: :2225
2024-04-19 15:44:13,811 - DEBUG - Login ID: None
2024-04-19 15:44:13,811 - DEBUG - Email To: alerts@example.com
2024-04-19 15:44:13,811 - DEBUG - Email From: sender@example.com
2024-04-19 15:44:13,811 - DEBUG - Loaded E-Mail URL: mailto://:2225/alerts%40example.com?format=html&overflow=upstream&rto=4.0&cto=15&verify=yes&from=sender%40example.com

The notification URL is:

mailto://10.0.0.195:2225/?to=alerts@example.com&from=sender@example.com

This a local postfix server without any authentication, and it doesnt even receive any incoming request.

This configuration has always worked and I didnt make any changes (except for updating the container) when it stopped working.

From the log this looks suspicous:

E-Mail URL: mailto://:2225/alerts%40example.com?format=html&overflow=upstream&rto=4.0&cto=15&verify=yes&from=sender%40example.com

It seems like it stripped the hostname from the URL, which would explain why it cannot connect.

Version
v0.45.20

To Reproduce

Create a notification URL like this:

mailto://10.0.0.195:2225/?to=alerts@example.com&from=sender@example.com

It fails to send any mail and it also doesnt show any test button.

Expected behavior

Emails that get delivered

@dgtlmoon
Copy link
Owner

dgtlmoon commented Apr 19, 2024

please try it first from the command line

echo hello|apprise mailto://10.0.0.195:2225/?to=alerts@example.com&from=sender@example.com

it is not a bug with changedetection but rather with apprise, does it work from the CLI?

and tell me the version of apprise installed pip3 list

@dgtlmoon dgtlmoon changed the title [Bug]: E-mail notifications broken [Bug]: E-mail notifications broken to email servers by IP address Apr 19, 2024
@dgtlmoon dgtlmoon added the upstream-bug issue with library - not directly with changedetection label Apr 19, 2024
@kroese
Copy link
Author

kroese commented Apr 19, 2024

Its version 1.7.6 and when I execute that command I get:

ERROR: There are no service(s) to notify

but the Loaded E-Mail URL contains the IP like expected, while in the Change Notification log the IP is stripped from that line.

@dgtlmoon
Copy link
Owner

dgtlmoon commented Apr 19, 2024

So its a problem in 1.7.6 of apprise then...

pip3 install apprise==1.7.5

$ ls|apprise "mailto://10.0.0.195:2225/?to=alerts@example.com&from=sender@example.com" -v
2024-04-20 00:05:05,126 - WARNING - Connection error while submitting email to 10.0.0.195. Reason: [Errno 111] Connection refused

pip3 install apprise==1.7.6

$ ls|apprise "mailto://10.0.0.195:2225/?to=alerts@example.com&from=sender@example.com" -v
2024-04-20 00:05:57,440 - WARNING - Sending email to "alerts@example.com" failed. Reason: please run connect() first
2024-04-20 00:05:57,440 - ERROR - Unhandled Notification Exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/apprise/Apprise.py", line 582, in _notify_sequential
    result = server.notify(**kwargs)
  File "/usr/local/lib/python3.10/dist-packages/apprise/plugins/NotifyBase.py", line 382, in notify
    the_calls = [self.send(**kwargs2) for kwargs2 in send_calls]
  File "/usr/local/lib/python3.10/dist-packages/apprise/plugins/NotifyBase.py", line 382, in <listcomp>
    the_calls = [self.send(**kwargs2) for kwargs2 in send_calls]
  File "/usr/local/lib/python3.10/dist-packages/apprise/plugins/NotifyEmail.py", line 855, in send
    return self.submit(messages)
  File "/usr/local/lib/python3.10/dist-packages/apprise/plugins/NotifyEmail.py", line 921, in submit
    socket.quit()
  File "/usr/lib/python3.10/smtplib.py", line 1004, in quit
    res = self.docmd("quit")
  File "/usr/lib/python3.10/smtplib.py", line 431, in docmd
    self.putcmd(cmd, args)
  File "/usr/lib/python3.10/smtplib.py", line 378, in putcmd
    self.send(f'{s}{CRLF}')
  File "/usr/lib/python3.10/smtplib.py", line 365, in send
    raise SMTPServerDisconnected('please run connect() first')
smtplib.SMTPServerDisconnected: please run connect() first

@kroese please can you make an issue over at caronc/apprise? this is not our fault here

@dgtlmoon
Copy link
Owner

@kroese please make an issue at https://github.com/caronc/apprise and link this issue in the issue comment

@dgtlmoon dgtlmoon added bug Something isn't working Notifications systems Development of notifications of changes and removed triage labels Apr 19, 2024
@dgtlmoon dgtlmoon changed the title [Bug]: E-mail notifications broken to email servers by IP address [Bug]: (apprise) E-mail notifications broken to email servers by IP address Apr 19, 2024
@kroese
Copy link
Author

kroese commented Apr 19, 2024

Okay, thanks! I reported it and will take it further with them.

On a sidenote, do you have any idea why I dont see the button to test notifications in v0.45.20? I know you recently changed something in that area of the code, but I cant find it anywhere.

@dgtlmoon
Copy link
Owner

On a sidenote, do you have any idea why I dont see the button to test notifications in v0.45.20? I know you recently changed something in that area of the code, but I cant find it anywhere.

hmm please open a new issue and include some screenshots and which browser/platform/browser version etc

dgtlmoon added a commit that referenced this issue May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Notifications systems Development of notifications of changes upstream-bug issue with library - not directly with changedetection
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants