Majordomo's aliases can be added to the main aliases file. However, creating a second aliases file for the Majordomo aliases, such as /usr/local/majordomo/majordomo.aliases, is a good idea.
To have a /usr/local/majordomo/majordomo.aliases, Sendmail must be able to generate a database (/usr/local/majordomo/majordomo.aliases.db). The easiest way to accomplish this is to go ahead and create an empty database for Sendmail to overwrite.
[root@majordomohowto majordomo]# touch majordomo.aliases.db [root@majordomohowto majordomo]# chmod 644 majordomo.aliases.db
If you want to edit the sendmail.cf directly, add the following line to your sendmail.cf file.
OA/usr/local/majordomo/majordomo.aliases
If you prefer to use M4 macros, add the following line to your sendmail.mc file, and regenerate sendmail.cf.
define(`ALIAS_FILE',`/etc/aliases,/usr/local/majordomo/majordomo.aliases')
On some systems, you must run newaliases to update the aliases database after modifying the aliases file.
Add the following directors to the configuration portion of the exim.conf file. (If this section is not clearly marked in the comments of your exim.conf, you can safely add the director for a second aliases file after the system_aliases director.)
# Majordomo's Aliases File additional_aliases1: driver = aliasfile file_transport = address_file pipe_transport = address_pipe file = /usr/local/majordomo/majordomo.aliases search_type = lsearch user = majordomNote that the user = majordom specifies that Exim will change its user to majordom before redirecting mail to aliases in majordomo.aliases. Thus, by giving a user access to the majordomo.aliases file, you don't need to give that user the ability to execute programs under the user Exim runs under.
Add hash:/usr/local/majordomo/majordomo.aliases to the alias_maps option in the main Postfix configuration file (usually /etc/postfix/main.cf). Note that items in a list are separated by commas. For example, if there is a current entry similar to
alias_maps = hash:/etc/aliasesmodify that entry to look like
alias_maps = hash:/etc/aliases, hash:/usr/local/majordomo/majordomo.aliases
Note that after modifying Majordomo's aliases, you will have to rebuild the aliases database. Postfix uses this database (not the aliases file itself) to lookup mailing aliases. For example, as majordom
[majordom@majordomohowto ~]$ newaliases -oAhash:/usr/local/majordomo/majordomo.aliases