There is nothing special to do on the POP user side, which is a good thing(tm): We want to merge several email servers in one box, we don't want to tell everyone about it :-)
The trick to read the mail is exactly the same as with virtual WWW: You need IP addresses. Mostly here is the setup. Suppose we want to create 3 virtual email domains: va.foo.com, vb.foo.com, vc.foo.com. Think about it in the same way as you would do for installing 3 independent servers, each serving one single email domain. This is what we will describe here and at the end, we will show how these 3 servers can be merged in a single machine.
From a DNS standpoint, we have one email server per domain. So the MX of each domain is
With the DNS, this is what we are telling the world. This is also what we are telling to email users. Mostly va.foo.com users, get your mail at mailhost.va.foo.com, vb.foo.com users, get your mail at mailhost.vb.foo.com and so on.
So far, with such a setup, we could very well have 1 server (real one) per email domain (The current state of affair before virtual email domain).
To continue the setup (be it real or virtual), we go in the DNS and allocate an IP number for each server (this is the key). Here I am using private IP numbers as an example. One will see that I have allocated IP numbers from the same network.
Then we could go and install 3 linux server with those IP and tell Sendmail on each one to accept one of the three domain.
Instead of installing 3 linux servers, we install a single one. For each virtual email domain, we must
"networking/IP aliases for virtual hosts"
.
The IP alias is the key. The POP protocol has no way to identify the target of a request, except with the IP destination number. This is why POP clients must use a different name (a different IP in fact) to read the messages from different email domains. From their point of view, this is expected anyway.