The path that a mail message follows during delivery depends on the setup of the client system and the topology of the mail domain. Each additional level of mail hosts or mail domains can add another alias resolution, but the routing process is basically the same on most hosts.
You can set up a client system to receive mail locally. Receiving mail locally is known as running sendmail in local mode. Local mode is the default for all mail servers and some clients. On a mail server or a mail client in local mode, a mail message is routed the following way.
Note - The following example assumes that you are using the default rule set in the sendmail.cf file.
Expand the mail alias, if possible, and restart the local routing process.
The mail address is expanded by checking for the mail alias in the name service and substituting the new value, if a new value is found. This new alias is then checked again.
If the mail is local, deliver the mail to /usr/lib/mail.local.
The mail is delivered to a local mailbox.
If the mail address includes a host in this mail domain, deliver the mail to that host.
If the address does not include a host in this domain, forward the mail to the mail host.
The mail host uses the same routing process as the mail server. However, the mail host can receive mail that is addressed to the domain name as well as to the host name.