def relay_ip_list(name, addresses=None, server=_DEFAULT_SERVER):
 ret = {'name': name, 'changes': {}, 'comment': str(), 'result': None}
 current_addresses = __salt__['win_smtp_server.get_relay_ip_list'](server=server)
 if addresses:
  if (addresses[0] == 'None'):
   addresses[0] = None
 elif (addresses is None):
  addresses = [None]
 if (addresses == current_addresses):
  ret['comment'] = 'RelayIpList already contains the provided addresses.'
  ret['result'] = True
 elif __opts__['test']:
  ret['comment'] = 'RelayIpList will be changed.'
  ret['changes'] = {'old': current_addresses, 'new': addresses}
 else:
  ret['comment'] = 'Set RelayIpList to contain the provided addresses.'
  ret['changes'] = {'old': current_addresses, 'new': addresses}
  ret['result'] = __salt__['win_smtp_server.set_relay_ip_list'](addresses=addresses, server=server)
 return ret

def relay_ip_list ( name , addresses = None , server = _DEFAULT_SERVER ) : ret = { 'name' : name , 'changes' : { } , 'comment' : str ( ) , 'result' : None } current_addresses = __salt__ [ 'win_smtp_server.get_relay_ip_list' ] ( server = server ) if addresses : if ( addresses [ 0 ] == 'None' ) : addresses [ 0 ] = None elif ( addresses is None ) : addresses = [ None ] if ( addresses == current_addresses ) : ret [ 'comment' ] = 'RelayIpList already contains the provided addresses.' ret [ 'result' ] = True elif __opts__ [ 'test' ] : ret [ 'comment' ] = 'RelayIpList will be changed.' ret [ 'changes' ] = { 'old' : current_addresses , 'new' : addresses } else : ret [ 'comment' ] = 'Set RelayIpList to contain the provided addresses.' ret [ 'changes' ] = { 'old' : current_addresses , 'new' : addresses } ret [ 'result' ] = __salt__ [ 'win_smtp_server.set_relay_ip_list' ] ( addresses = addresses , server = server ) return ret
manage ip list for smtp relay connections .