fix: fix mailserver getting a random with a possible wrong index

This commit is contained in:
Jonathan Rainville 2020-08-25 09:30:00 -04:00 committed by Iuri Matias
parent 898bb27b56
commit 273d565e9e
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ proc autoConnect*(self: MailserverModel) =
# Picks a random mailserver amongs the ones with the lowest latency
# The pool size is 1/4 of the mailservers were pinged successfully
randomize()
let mailServer = availableMailservers[rand(poolSize(availableMailservers.len))][0]
let mailServer = availableMailservers[rand(poolSize(availableMailservers.len - 1))][0]
self.connect(mailserver)
proc changeMailserver*(self: MailserverModel) =