def set_relay_ip_list(addresses=None, server=_DEFAULT_SERVER):
 setting = 'RelayIpList'
 formatted_addresses = list()
 current_addresses = get_relay_ip_list(server)
 if (list(addresses) == current_addresses):
  _LOG.debug('%s already contains the provided addresses.', setting)
  return True
 if addresses:
  if (addresses[0] is None):
   formatted_addresses = None
  else:
   for address in addresses:
    for octet in address.split('.'):
     formatted_addresses.append(octet)
 _LOG.debug('Formatted %s addresses: %s', setting, formatted_addresses)
 _set_wmi_setting('IIsSmtpServerSetting', setting, formatted_addresses, server)
 new_addresses = get_relay_ip_list(server)
 ret = (list(addresses) == new_addresses)
 if ret:
  _LOG.debug('%s configured successfully: %s', setting, addresses)
  return ret
 _LOG.error('Unable to configure %s with value: %s', setting, addresses)
 return ret

def set_relay_ip_list ( addresses = None , server = _DEFAULT_SERVER ) : setting = 'RelayIpList' formatted_addresses = list ( ) current_addresses = get_relay_ip_list ( server ) if ( list ( addresses ) == current_addresses ) : _LOG . debug ( '%s already contains the provided addresses.' , setting ) return True if addresses : if ( addresses [ 0 ] is None ) : formatted_addresses = None else : for address in addresses : for octet in address . split ( '.' ) : formatted_addresses . append ( octet ) _LOG . debug ( 'Formatted %s addresses: %s' , setting , formatted_addresses ) _set_wmi_setting ( 'IIsSmtpServerSetting' , setting , formatted_addresses , server ) new_addresses = get_relay_ip_list ( server ) ret = ( list ( addresses ) == new_addresses ) if ret : _LOG . debug ( '%s configured successfully: %s' , setting , addresses ) return ret _LOG . error ( 'Unable to configure %s with value: %s' , setting , addresses ) return ret
set the relayiplist list for the smtp virtual server .