HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/smtp.cpython-310.pyc
o

�N�g!	�@s"dZdd�Z				ddd�ZdS)am
Sending Messages via SMTP
==========================

.. versionadded:: 2014.7.0

This state is useful for firing messages during state runs, using the SMTP
protocol

.. code-block:: yaml

    server-warning-message:
      smtp.send_msg:
        - name: 'This is a server warning message'
        - profile: my-smtp-account
        - recipient: admins@example.com
cCsdtvrdSdS)z?
    Only load if the SMTP module is available in __salt__
    �
smtp.send_msgZsmtp)Fzsmtp module could not be loaded)�__salt__�rr�D/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/smtp.py�__virtual__srN�Truec
	Cs�|iddd�}|dur|durd|d<d|d<|Stdr'd	�||�|d<|Std
|||||||d�}|rXd|d<|rLd
�|�}	d�|||	�|d<|Sd|�d|��|d<|Sd|d<d|�d|��|d<|S)a�
    Send a message via SMTP

    .. code-block:: yaml

        server-warning-message:
          smtp.send_msg:
            - name: 'This is a server warning message'
            - profile: my-smtp-account
            - subject: 'Message from Salt'
            - recipient: admin@example.com
            - sender: admin@example.com
            - use_ssl: True
            - attachments:
                - /var/log/syslog
                - /var/log/messages

    name
        The message to send via SMTP
    N�)�nameZchanges�result�commentFr	z;Missing parameter sender or profile for state smtp.send_msgr
�testzNeed to send message to {}: {}r)�message�	recipient�profile�subject�sender�use_ssl�attachmentsTz, z/Sent message to {0} with attachments ({2}): {1}zSent message to z: zUnable to send message to )Z__opts__�formatr�join)
rr
rrrrr�retZcommandZattsrrr�send_msgsB��

���r)NNrN)�__doc__rrrrrr�<module>s
�