salt.states.win_smtp_server

Module for managing IIS SMTP server configuration on Windows servers.

salt.states.win_smtp_server.active_log_format(name, log_format, server='SmtpSvc/1')

Manage the active log format for the SMTP server.

Parameters:
  • log_format (str) -- The log format name.

  • server (str) -- The SMTP server name.

Example of usage:

smtp-log-format:
    win_smtp_server.active_log_format:
        - log_format: Microsoft IIS Log File Format
salt.states.win_smtp_server.connection_ip_list(name, addresses=None, grant_by_default=False, server='SmtpSvc/1')

Manage IP list for SMTP connections.

Parameters:
  • addresses (str) -- A dictionary of IP + subnet pairs.

  • grant_by_default (bool) -- Whether the addresses should be a blacklist or whitelist.

  • server (str) -- The SMTP server name.

Example of usage for creating a whitelist:

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:

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:

smtp-connection-blacklist:
    win_smtp_server.connection_ip_list:
        - addresses: {}
        - grant_by_default: True
salt.states.win_smtp_server.relay_ip_list(name, addresses=None, server='SmtpSvc/1')

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:

['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.

Parameters:
  • addresses (str) -- A list of the relay IPs. The order of the list is important.

  • server (str) -- The SMTP server name.

Example of usage:

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:

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

Example of usage for allowing relaying from any source:

smtp-relay-list:
    win_smtp_server.relay_ip_list:
        - addresses: []
salt.states.win_smtp_server.server_setting(name, settings=None, server='SmtpSvc/1')

Ensure the value is set for the specified setting.

Note

The setting names are case-sensitive.

Parameters:
  • settings (str) -- A dictionary of the setting names and their values.

  • server (str) -- The SMTP server name.

Example of usage:

smtp-settings:
    win_smtp_server.server_setting:
        - settings:
            LogType: 1
            LogFilePeriod: 1
            MaxMessageSize: 16777216
            MaxRecipients: 10000
            MaxSessionSize: 16777216