Hi,
Before ten years, I did something similar, not with qmail though, when Red Hat was a baby.
I think, although I am not sure, that you may achieve this with qmail by using the function of smtproutes.
You need to map IPs to MX domains and then use Domain Routing in Qmail.
That is a function that always existed and is an important function.