Module for managing IIS SMTP server configuration on Windows servers. The Windows features 'SMTP-Server' and 'Web-WMI' must be installed.
wmi
Get the IPGrant list for the SMTP virtual server.
as_wmi_format (bool) -- Returns the connection IPs as a list in the format WMI expects.
server (str) -- The SMTP server name.
A dictionary of the IP and subnet pairs.
dict
CLI Example:
salt '*' win_smtp_server.get_connection_ip_list
Get the active log format for the SMTP virtual server.
server (str) -- The SMTP server name.
A string of the log format name.
str
CLI Example:
salt '*' win_smtp_server.get_log_format
Get all available log format names and ids.
A dictionary of the log format names and ids.
dict
CLI Example:
salt '*' win_smtp_server.get_log_format_types
Get the RelayIpList list for the SMTP virtual server.
server (str) -- The SMTP server name.
A list of the relay IPs.
list
Note
A return value of None corresponds to the restrictive 'Only the list below' GUI parameter with an empty access list, and setting an empty list/tuple corresponds to the more permissive 'All except the list below' GUI parameter.
CLI Example:
salt '*' win_smtp_server.get_relay_ip_list
Get the value of the setting for the SMTP virtual server.
settings (str) -- A list of the setting names.
server (str) -- The SMTP server name.
A dictionary of the provided settings and their values.
dict
CLI Example:
salt '*' win_smtp_server.get_server_setting settings="['MaxRecipients']"
Get the SMTP virtual server names.
A list of the SMTP virtual servers.
list
CLI Example:
salt '*' win_smtp_server.get_servers
Set the IPGrant list for the SMTP virtual server.
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.
A boolean representing whether the change succeeded.
bool
CLI Example:
salt '*' win_smtp_server.set_connection_ip_list addresses="{'127.0.0.1': '255.255.255.255'}"
Set the active log format for the SMTP virtual server.
log_format (str) -- The log format name.
server (str) -- The SMTP server name.
A boolean representing whether the change succeeded.
bool
CLI Example:
salt '*' win_smtp_server.set_log_format 'Microsoft IIS Log File Format'
Set the RelayIpList list for the SMTP virtual server.
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.
addresses (str) -- A list of the relay IPs. The order of the list is important.
server (str) -- The SMTP server name.
A boolean representing whether the change succeeded.
bool
CLI Example:
salt '*' win_smtp_server.set_relay_ip_list addresses="['192.168.1.1', '172.16.1.1']"
Set the value of the setting for the SMTP virtual server.
Note
The setting names are case-sensitive.
settings (str) -- A dictionary of the setting names and their values.
server (str) -- The SMTP server name.
A boolean representing whether all changes succeeded.
bool
CLI Example:
salt '*' win_smtp_server.set_server_setting settings="{'MaxRecipients': '500'}"