the login processing

$loginname +-->$loginuser----->+                   +-->$auth_user---+---> auth system ---> $domain, $user, $uid, $gid, $homedir
           |                   |                   |                                                   |
           v                   |                   |                ^                                  v
           |                   |                   |                |                                  |
 $logindomain derives form     |                   |                |auth_withdomain=yes?              |
                               |                   |                |                          load per user conf
 1. domain in loginname        +-> virtusertable ->+           $auth_domain                    for $domain/$user
 2. cgi param(logindomain)     |                   |                |                                  |
 3. domain in URL              |                   |                |                                  |
           |                   ^                   |                ^                                  v
           v                   |                   |                |                                  |
           |           get all equivalent          |           override by                     email address from
      $logindomain     domainnames from            |        auth_domain option
           |           domainnames_equiv           |                |                          1. virtusertable
   mapped with option          |                   |                |                          2. domainnames (override 1 if option domainnames_override=yes)
    domainname_equiv           ^                   |                ^                             a. user specify
           |                   |                   |                |                             b. domain in loginname
           v          load per domain conf         |                |                                domain in URL
           |                   |                   |                |                             c. domain by /bin/hostname
           +-->$logindomain--->+                   +-->$auth_domain-+                          3. ~/mail/.form.book


Note:

1.loginuser may not equal to $auth_user
  $auth_user may not equal to $user
  $logindomain may not equal to $auth_domain
  $auth_domain may not equal to $domain
2.virtusertable is actually more likely a alias table
3.per user conf is loaded based on the final $domain/$user
  not the $logindomain/$loginuser
