You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i.e. as a profile has to be used with the smtp.send_msg state, the values of the sender and use_ssl arguments are replaced by the values given in the profile - which means any values of use_ssl and sender given to state are ignored ...
ifprofileisNoneandsenderisNone:
ret["result"] =Falseret["comment"] ="Missing parameter sender or profile for state smtp.send_msg"returnret
as the sender argument is never used, and the profile must be set, then there is no point testing if the sender is set ...
One simple fix to this is to add a server argument to the smtp.send_msg state - this would then allow a server and sender (plus use_ssl) arguments to be used without using a profile - i.e. use server/sender/use_ssl or profile arguments
Setup
Using 3006.9 on master and minion
on-prem machine
VM (Nutanix)
onedir packaging
Versions Report
salt --versions-report
Salt Version:
Salt: 3006.9Python Version:
Python: 3.10.14 (main, Jun 26 2024, 11:44:37) [GCC 11.2.0]Dependency Versions:
cffi: 1.14.6cherrypy: 18.6.1cryptography: 42.0.5dateutil: 2.8.1docker-py: Not Installedgitdb: 4.0.11gitpython: 3.1.43Jinja2: 3.1.4libgit2: Not Installedlooseversion: 1.0.2M2Crypto: Not InstalledMako: Not Installedmsgpack: 1.0.2msgpack-pure: Not Installedmysql-python: Not Installedpackaging: 22.0pycparser: 2.21pycrypto: Not Installedpycryptodome: 3.19.1pygit2: Not Installedpython-gnupg: 0.4.8PyYAML: 6.0.1PyZMQ: 23.2.0relenv: 0.17.0smmap: 5.0.1timelib: 0.2.4Tornado: 4.5.3ZMQ: 4.3.4System Versions:
dist: rocky 9.4 Blue Onyxlocale: utf-8machine: x86_64release: 5.14.0-427.24.1.el9_4.x86_64system: Linuxversion: Rocky Linux 9.4 Blue Onyx
The text was updated successfully, but these errors were encountered:
Description
The documentation for salt.states.smtp.send_msg gives the usage as:
However, to be able to send an SMTP email a
server
is required, but there is noserver
argument to salt.states.smtp.send_msgThe only way to specify a server is via the profile argument - something like:
The
smtp.send_msg
state calls thesmtp.send_msg
module, by passing its arguments to the module - however, the module code does:i.e. as a profile has to be used with the smtp.send_msg state, the values of the
sender
anduse_ssl
arguments are replaced by the values given in theprofile
- which means any values ofuse_ssl
andsender
given to state are ignored ...Also, the smtp.send_msg state code does:
as the
sender
argument is never used, and theprofile
must be set, then there is no point testing if thesender
is set ...One simple fix to this is to add a
server
argument to the smtp.send_msg state - this would then allow aserver
andsender
(plususe_ssl
) arguments to be used without using aprofile
- i.e. useserver/sender/use_ssl
orprofile
argumentsSetup
Using 3006.9 on master and minion
Versions Report
salt --versions-report
The text was updated successfully, but these errors were encountered: