%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/win_smtp_server.pyo

�
���^c@@s�dZddlmZmZmZddlmZddlZdZ	d�Z
d�Zd�Zde	d	�Ze	d
�Zdee	d�Zde	d�ZdS(
uH
Module for managing IIS SMTP server configuration on Windows servers.

i(tabsolute_importtunicode_literalstprint_function(tsixNu	SmtpSvc/1cC@sdtkrtStS(uD
    Load only on minions that have the win_smtp_server module.
    u"win_smtp_server.get_server_setting(t__salt__tTruetFalse(((s?/usr/lib/python2.7/site-packages/salt/states/win_smtp_server.pyt__virtual__scG@s+t�}x|D]}|j|�qW|S(uN
    Shallow copy and merge dicts together, giving precedence to last in.
    (tdicttupdate(targstrettarg((s?/usr/lib/python2.7/site-packages/salt/states/win_smtp_server.pyt_merge_dictss	
cK@s�t�}tjjj|�}x^|D]V}t||t�rmttj||��}dj	|�||<q%||||<q%W|S(u_
    Convert setting values that has been improperly converted to a dict back to a string.
    u{{{0}}}(
RtsalttutilsR
tclean_kwargst
isinstancetnextRtiterkeystformat(tsettingsRtsettingtvalue_from_key((s?/usr/lib/python2.7/site-packages/salt/states/win_smtp_server.pyt_normalize_server_settings%s	
cC@s)i|d6id6tj�d6dd6}|sFd|d<t|d<|St�}i|d<i|d<tdd|j�d	|�}xg|D]_}t|�}tj||�tj||�kr�i||d
6||d6|d|<q�q�W|dsd|d<t|d<|Std
r0d|d<||d<|Stdd|d	|�tdd|j�d	|�}xo|D]g}tj||�tj||�krmi||d
6||d6|d|<|dj	|d�qmqmW|drd|d<||d<t
|d<n"d|d<|d|d<t|d<|S(uM
    Ensure the value is set for the specified setting.

    .. note::

        The setting names are case-sensitive.

    :param str settings: A dictionary of the setting names and their values.
    :param str server: The SMTP server name.

    Example of usage:

    .. code-block:: yaml

        smtp-settings:
            win_smtp_server.server_setting:
                - settings:
                    LogType: 1
                    LogFilePeriod: 1
                    MaxMessageSize: 16777216
                    MaxRecipients: 10000
                    MaxSessionSize: 16777216
    unameuchangesucommenturesultuNo settings to change provided.ufailuresu"win_smtp_server.get_server_settingRtserveruoldunewu-Settings already contain the provided values.utestuSettings will be changed.u"win_smtp_server.set_server_settinguSome settings failed to change.u,Set settings to contain the provided values.N(Rt	text_typetNoneRRRtkeysRt__opts__tpopR(tnameRRRtret_settingstcurrent_settingstkeytnew_settings((s?/usr/lib/python2.7/site-packages/salt/states/win_smtp_server.pytserver_setting6sT




	

	
&





	
&





cC@s�i|d6id6tj�d6d
d6}td|�}||kr[d|d<t|d<nhtdr�d|d<i|d	6|d
6|d<n9d|d<i|d	6|d
6|d<td||�|d<|S(uO
    Manage the active log format for the SMTP server.

    :param str log_format: The log format name.
    :param str server: The SMTP server name.

    Example of usage:

    .. code-block:: yaml

        smtp-log-format:
            win_smtp_server.active_log_format:
                - log_format: Microsoft IIS Log File Format
    unameuchangesucommenturesultuwin_smtp_server.get_log_formatuBLogPluginClsid already contains the id of the provided log format.utestuLogPluginClsid will be changed.uoldunewu@Set LogPluginClsid to contain the id of the provided log format.uwin_smtp_server.set_log_formatN(RRRRRR(Rt
log_formatRRtcurrent_log_format((s?/usr/lib/python2.7/site-packages/salt/states/win_smtp_server.pytactive_log_format�s"









cC@s�i|d6id6tj�d6dd6}|s:t�}ntdd|�}||krpd|d<t|d<nttdr�d	|d<i|d
6|d6|d<nEd|d<i|d
6|d6|d<td
d|d|d|�|d<|S(u�
    Manage IP list for SMTP connections.

    :param str addresses: A dictionary of IP + subnet pairs.
    :param bool grant_by_default: Whether the addresses should be a blacklist or whitelist.
    :param str server: The SMTP server name.

    Example of usage for creating a whitelist:

    .. code-block:: yaml

        smtp-connection-whitelist:
            win_smtp_server.connection_ip_list:
                - addresses:
                    127.0.0.1: 255.255.255.255
                    172.16.1.98: 255.255.255.255
                    172.16.1.99: 255.255.255.255
                - grant_by_default: False

    Example of usage for creating a blacklist:

    .. code-block:: yaml

        smtp-connection-blacklist:
            win_smtp_server.connection_ip_list:
                - addresses:
                    172.16.1.100: 255.255.255.255
                    172.16.1.101: 255.255.255.255
                - grant_by_default: True

    Example of usage for allowing any source to connect:

    .. code-block:: yaml

        smtp-connection-blacklist:
            win_smtp_server.connection_ip_list:
                - addresses: {}
                - grant_by_default: True
    unameuchangesucommenturesultu&win_smtp_server.get_connection_ip_listRu0IPGrant already contains the provided addresses.utestuIPGrant will be changed.uoldunewu.Set IPGrant to contain the provided addresses.u&win_smtp_server.set_connection_ip_listt	addressestgrant_by_defaultN(RRRRRRR(RR(R)RRtcurrent_addresses((s?/usr/lib/python2.7/site-packages/salt/states/win_smtp_server.pytconnection_ip_list�s*(










cC@si|d6id6tj�d6dd6}tdd|�}|ra|ddkryd|d<qyn|dkrydg}n||kr�d	|d<t|d<nntd
r�d|d<i|d6|d
6|d<n?d|d<i|d6|d
6|d<tdd|d|�|d<|S(u[
    Manage IP list for SMTP relay connections.

    Due to the unusual way that Windows stores the relay IPs, it is advisable to retrieve
    the existing list you wish to set from a pre-configured server.

    For example, setting '127.0.0.1' as an allowed relay IP through the GUI would generate
    an actual relay IP list similar to the following:

    .. code-block:: cfg

        ['24.0.0.128', '32.0.0.128', '60.0.0.128', '68.0.0.128', '1.0.0.0', '76.0.0.0',
          '0.0.0.0', '0.0.0.0', '1.0.0.0', '1.0.0.0', '2.0.0.0', '2.0.0.0', '4.0.0.0',
          '0.0.0.0', '76.0.0.128', '0.0.0.0', '0.0.0.0', '0.0.0.0', '0.0.0.0',
          '255.255.255.255', '127.0.0.1']

    .. note::

        Setting the list to None corresponds to the restrictive 'Only the list below' GUI parameter
        with an empty access list configured, and setting an empty list/tuple corresponds to the
        more permissive 'All except the list below' GUI parameter.

    :param str addresses: A list of the relay IPs. The order of the list is important.
    :param str server: The SMTP server name.

    Example of usage:

    .. code-block:: yaml

        smtp-relay-list:
          win_smtp_server.relay_ip_list:
            - addresses:
                - 24.0.0.128
                - 32.0.0.128
                - 60.0.0.128
                - 1.0.0.0
                - 76.0.0.0
                - 0.0.0.0
                - 0.0.0.0
                - 1.0.0.0
                - 1.0.0.0
                - 2.0.0.0
                - 2.0.0.0
                - 4.0.0.0
                - 0.0.0.0
                - 76.0.0.128
                - 0.0.0.0
                - 0.0.0.0
                - 0.0.0.0
                - 0.0.0.0
                - 255.255.255.255
                - 127.0.0.1

    Example of usage for disabling relaying:

    .. code-block:: yaml

        smtp-relay-list:
            win_smtp_server.relay_ip_list:
                - addresses: None

    Example of usage for allowing relaying from any source:

    .. code-block:: yaml

        smtp-relay-list:
            win_smtp_server.relay_ip_list:
                - addresses: []
    unameuchangesucommenturesultu!win_smtp_server.get_relay_ip_listRiuNoneu4RelayIpList already contains the provided addresses.utestuRelayIpList will be changed.uoldunewu2Set RelayIpList to contain the provided addresses.u!win_smtp_server.set_relay_ip_listR(N(RRRRRR(RR(RRR*((s?/usr/lib/python2.7/site-packages/salt/states/win_smtp_server.pyt
relay_ip_list�s,F









(t__doc__t
__future__RRRtsalt.extRtsalt.utils.argsRt_DEFAULT_SERVERRR
RRR$R'RR+R,(((s?/usr/lib/python2.7/site-packages/salt/states/win_smtp_server.pyt<module>s			
	M$B

Zerion Mini Shell 1.0