If mail is getting to your server, then sendmail has done it's job. If you have a user named joe, then his mail gets stored on the server as /var/spool/mail/joe. All of joes e-mail is in that one file. You can look at it with a text editor but it won't make much sense to you because everything is all jumbled together. For Joe to get his mail, he would use his trusty ol' mail client, Outlook Express. It is the client that creates the Inbox, Outbox and whateverbox. The mail client uses the following information: user name, password, name of mail servers and whether you want to get your mail via POP3 or IMAP. With POP3, the file is emptied after pop server sends the mail to the client and with imap, the user can leave the mail on the server. Now when joe@yourdomain.com requests his mail, DNS looks up the MX record for yourdomain.com and sees who handles the mail for that domain. The request is then sent to that ip address. If the request comes in on port 110, then the pop3 server handles it. The pop server assumes everything before the "@" is the username. If that user exists on the system, the password is checked. If everything is cool, the pop server sends /var/spool/mail/joe to the requesting client. The client then works its magic and breaks the file down into individual e-mails and stores them in Joe's Inbox. Since the job of the pop3 or imap servers are so simple, they usually never need configuration. All the configuring was done when the server was compiled. Sendmail on the other hand uses many files. Because you asked, I'll give you a brief rundown on the ones you'll most likely use.
1) /etc/mail/sendmail.mc - This file is a list of macros. It isn't used by sendmail. Sendmail uses sendmail.cf which is compiled from sendmail.mc using the macro compiler, m4.
Example: m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
2) /etc/mail/aliases - This file is just a list of fake names paired with real names with at least one tab in between them:
webmaster joe
sales fred
then names on the left MUST resolve to a real user on your system. When you are done editing this file, issue the following command: newaliases
3) /etc/mail/virtusertable - This file looks exactly like aliases but is more powerful. The entries can be an e-mail address, ip address, virtual user such as webmaster or an entire domain. Just as in the aliases file, the entries on the right MUST be valid destinations. When you are done, issue the following command:
makemap hash /etc/mail/virtusertable.db < /etc/mail/virtusertable
4) /etc/mail/access - This one is very inportant. It tells sendmail who can pass mail through your server. When you open it, you will see a few entries already there such as localhost and 127.0.0.1. Be sure to add your domain and public ip to the list:
yourdomain.com RELAY
xxx.xx.x.xx RELAY
If you have a user or domain that you no longer want to use you server you would add their name but use the word REJECT. When done issue the following comand:
makemap hash /etc/mail/access.db < /etc/mail/access
5) /etc/mail/local-host-names - Add your host name and any of its aliasses here
Don't forget to restart sendmail after editing most of theses.