linuxconf Howto/FAQ

Howto index

IP-less virtual domains and vpop3d

Generally, you need one IP per virtual email domain. You need that to retrieve messages. You do not need any IP for receive messages. The SMTP protocol carries enough information, allowing sendmail, then vdeliver, to distribute the messages properly.

If you want to achieve IP less with vpop3d, you need at one single IP for all virtual domains. vpop3d can tell apart which domain it is by looking at the login ID supplied by the user. So if a user supplies user@some_domain, vpop3d with select some_domain.

The pop-3 protocol has no provision to support vhost unlike HTTP which carry domain information in the request header. So we are using this trick with the user ID. Your vdomain users have to supply user@vdomain instead of just user. Most mail program handle that without noticing.

There is a catch with vpop3d: It does not manage the main domain at all. So it chains to the native pop-3 daemon to let it manage the main domain. To do so, it has to decide early at connect time if the native pop-3 server is handling the request or not. It has to decide this without reading a single line from the socket. The native pop-3 server expect to read everything from the socket.

So vpop3d has to decide if the request is for a virtual domain or the main domain based on the IP. It does a reverse look-up on the target IP. If it matches any vdomain, it handles the request itself. If it does not match any vdomain it chains to the native pop-3 server.

So to go IP Less with vpop3d, you need one IP for the server and one IP for all vdomains.

Now, a simpler solution is to use the vimap package available from http://vimap.sourceforge.net, at least on red-hat system. The vimap package is a replacement for the standard imap package found on red-hat. You just upgrade to it. It does everything vpop3d does and more. Because the vimap package handles the main and virtual domains, it does not have to "decide early". It also supports the user@vdomain trick above.