salt.modules.win_smtp_server
Module for managing IIS SMTP server configuration on Windows servers. The Windows features 'SMTP-Server' and 'Web-WMI' must be installed.
- depends
-
wmi
-
Get the IPGrant list for the SMTP virtual server.
- Parameters
- Returns
-
A dictionary of the IP and subnet pairs.
- Return type
CLI Example:
salt '*' win_smtp_server.get_connection_ip_list
salt.modules.win_smtp_server.get_connection_ip_list(as_wmi_format=False, server='SmtpSvc/1')
-
Get the active log format for the SMTP virtual server.
- Parameters
-
server (str) -- The SMTP server name.
- Returns
-
A string of the log format name.
- Return type
CLI Example:
salt '*' win_smtp_server.get_log_format
salt.modules.win_smtp_server.get_log_format(server='SmtpSvc/1')
-
Get all available log format names and ids.
- Returns
-
A dictionary of the log format names and ids.
- Return type
CLI Example:
salt '*' win_smtp_server.get_log_format_types
salt.modules.win_smtp_server.get_log_format_types()
-
Get the RelayIpList list for the SMTP virtual server.
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
salt.modules.win_smtp_server.get_relay_ip_list(server='SmtpSvc/1')
-
Get the value of the setting for the SMTP virtual server.
- Parameters
- Returns
-
A dictionary of the provided settings and their values.
- Return type
CLI Example:
salt '*' win_smtp_server.get_server_setting settings="['MaxRecipients']"
salt.modules.win_smtp_server.get_server_setting(settings, server='SmtpSvc/1')
-
Get the SMTP virtual server names.
- Returns
-
A list of the SMTP virtual servers.
- Return type
CLI Example:
salt '*' win_smtp_server.get_servers
salt.modules.win_smtp_server.get_servers()
-
Set the IPGrant list for the SMTP virtual server.
- Parameters
- Returns
-
A boolean representing whether the change succeeded.
- Return type
CLI Example:
salt '*' win_smtp_server.set_connection_ip_list addresses="{'127.0.0.1': '255.255.255.255'}"
salt.modules.win_smtp_server.set_connection_ip_list(addresses=None, grant_by_default=False, server='SmtpSvc/1')
-
Set the active log format for the SMTP virtual server.
- Parameters
- Returns
-
A boolean representing whether the change succeeded.
- Return type
CLI Example:
salt '*' win_smtp_server.set_log_format 'Microsoft IIS Log File Format'
salt.modules.win_smtp_server.set_log_format(log_format, server='SmtpSvc/1')
-
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.
- Parameters
- Returns
-
A boolean representing whether the change succeeded.
- Return type
CLI Example:
salt '*' win_smtp_server.set_relay_ip_list addresses="['192.168.1.1', '172.16.1.1']"
salt.modules.win_smtp_server.set_relay_ip_list(addresses=None, server='SmtpSvc/1')
-
Set the value of the setting for the SMTP virtual server.
Note
The setting names are case-sensitive.
- Parameters
- Returns
-
A boolean representing whether all changes succeeded.
- Return type
CLI Example:
salt '*' win_smtp_server.set_server_setting settings="{'MaxRecipients': '500'}"
salt.modules.win_smtp_server.set_server_setting(settings, server='SmtpSvc/1')
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.win_smtp_server.html