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

notify-host-mail: Does not support STARTTLS SMTP servers #752

Open
5 of 8 tasks
laison007 opened this issue Apr 4, 2024 · 0 comments
Open
5 of 8 tasks

notify-host-mail: Does not support STARTTLS SMTP servers #752

laison007 opened this issue Apr 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@laison007
Copy link

This issue respects the following points:

Which variant of the Monitoring Plugins do you use?

  • .rpm/.deb package from repo.linuxfabrik.ch
  • Compiled for Linux (.tar/.zip from download.linuxfabrik.ch)
  • Compiled for Windows (from download.linuxfabrik.ch)
  • Source Code from GitHub

Bug description

Hello friends.

I am trying to configure notifications for alarms, to be sent by mail to an address created for that purpose, in Office 365 and I have found that the plugin is not prepared for SMTP servers using STARTTLS, I have checked in the Python documentation that in the library used if STARTTLS is supported, but the script or plugin does not provide for this option.

I offer to test but my Python knowledge is limited.

Best regards.

Here is the error I get when running the notify-host-mail plugin

root@Icinga-Server:/usr/lib64/nagios/plugins# ./notify-host-mail --datetime 03/04/2023-17:00 --host-displayname Icinga-Server --host-state Down --mail-recipient @.com --mail-sender @.com --short
Traceback (most recent call last):
File "/usr/lib64/nagios/plugins/./notify-host-mail", line 497, in 'module'
main()
File "/usr/lib64/nagios/plugins/./notify-host-mail", line 491, in main
s.send_message(mail_msg)
File "/usr/lib/python3.11/smtplib.py", line 986, in send_message
return self.sendmail(from_addr, to_addrs, flatmsg, mail_options,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/smtplib.py", line 887, in sendmail
raise SMTPSenderRefused(code, resp, from_addr)
smtplib.SMTPSenderRefused: (451, b'5.7.3 STARTTLS is required to send mail [P**********.F*****.PROD.OUTLOOK.COM 2024-04-04T07:01:48.396Z ]', '@****.com')

Link to Python lib smtplib:

https://docs.python.org/3/library/smtplib.html

Steps to reproduce - Plugin call

notify-host-mail --datetime 03/04/2023-17:00 --host-displayname Icinga-Server --host-state Down --mail-recipient @.com --mail-sender @.com --short

Steps to reproduce - Data

No response

Environment

Linux Icinga-Server 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux

Plugin Version

notify-host-mail: v2023112901 by Linuxfabrik GmbH, Zurich/Switzerland

Python version

Python 3.11.2

List of Python modules

No response

Additional Information

No response

@laison007 laison007 added the bug Something isn't working label Apr 4, 2024
@markuslf markuslf added enhancement New feature or request and removed bug Something isn't working labels Apr 4, 2024
@markuslf markuslf changed the title notify-host-mailp not support STARTTLS SMTP servers notify-host-mail: Does not support STARTTLS SMTP servers Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants