I’ve built a patch to the standard qmail-remote.c and a patch to the qmail-remote.c resulting from patching with the SSL/TLS patch. They implement probabilistic load balancing of outgoing smtproutes.
Here’s an excerpt from a post to the qmail mailing list about them:
It’s probably easiest to give an example.
Previous smtproutes entries work as normal, but qmail-remote now
supports:
host.domain:host1:port1@weight1/host2@weight2/host3
.domain:host1:port1@weight1/host2@weight2/host3
Each of these lines will be interpreted as a set of three relay
hosts, host1 has port1 and weight1, specified as unsigned longs.
host2 has a port of 25 and weight2, specified as an unsigned
long. host3 has a port of 25 and a weight of 1.
qmail-remote totals the weights, uses srandomdev() (under freebsd
this is what I wanted - change this to the seeding behavior you
want) and random() to get a random number, and then iterates
through its list of weighted relay hosts until it finds the one
that corresponds to the random number.