An MTA's aliases file (often /etc/aliases) is used for redirecting email. For example, once Majordomo is installed, an entry in an aliases file usually reads
majordomo-owner: jarchieThis entry means that all mail addressed to majordomo-owner@majordomohowto.com will be resent to jarchie@majordomohowto.com. Notice it is unnecessary to append the @majordomohowto.com to jarchie because both users are on the same host. If one wanted to redirect the message to a different user on a different host, one must add the @majordomohowto.com portion.
Another type of entry in the aliases file allows email to be redirected to multiple addresses listed in a file.
test: ":include:/usr/local/majordomo/lists/test"This entry states that any message sent to test@host.com will be redirected to all the addresses listed in the file /usr/local/majordomo/lists/test. The test file might look something like this:
johnarchie@emeraldis.com srobirds@yahoo.com acreswell@geocities.comMajordomo is able to add or remove addresses from a list by using this feature. When a subscribe request is processed, the user's email address is appended to the test file; when an unsubscribe request is processed, the user's email address is removed from the test file. One can also add or remove addresses manually simply by editing the file with a text editor.
Since Majordomo need be able to process commands sent to it via email, the MTA must be able to execute the Majordomo program and pass the message to it. This is done by adding another type of entry to the aliases file:
majordomo: "|/usr/local/majordomo/wrapper majordomo"The program /usr/local/majordomo-1.94.5/wrapper is a wrapper (SUID root that sets the active UID and GID to the UID and GID of Majordomo (usually majordom and majordom) and runs the Majordomo program. The quotation marks around the second part of the alias entry are used to tell Sendmail that this part of the entry is all one statement; the quotation marks would be unnecessary if there were not a space between wrapper and majordomo. The | is known as a "pipe;" it is used to tell Sendmail to send the email to the wrapper via the standard input. (Since all the wrapper does here is to call majordomo, the email is actually being sent to Majordomo.) The wrapper accepts one parameter--the parameter of the program it is supposed to execute. (Any parameters after the first will be passed to the program the wrapper is executing.) For security reasons, the wrapper only executes programs located in the Majordomo directory, /usr/local/majordomo-1.94.5/. This restriction prevents a programmer from using the wrapper to run programs that should not have Majordomo privileges. (For example, wrapper /bin/vi would allow any user to edit any Majordomo configuration file.) When a message is sent to majordomo@host.com, Sendmail starts up the wrapper which, in turn, starts up majordomo, and Sendmail sends the message to the majordomo script via the standard input. Majordomo then extracts the commands from the message and responds appropriately.