AliasFile

Define the aliases file location All versions

The AliasFile option must be declared for sendmail to do aliasing. If you omit this option, sendmail might silently assume that you do not want to do aliasing at all. There is no default compiled into sendmail for the location of the aliases file.[362] For mc configurations, an appropriate default will be defined based on your operating system.

If you specify a file that doesn’t exist (such as /et/mail/aliases if you really meant /etc/mail/aliases) or one that is unreadable, sendmail complains with, for example:

Can't open /et/mail/aliases

This is a nonfatal error. The sendmail program prints it and continues to run but assumes that it shouldn’t do aliasing.

The forms of the AliasFile option are as follows:

O AliasFile=locationconfiguration file (V8.7 and later)
-OAliasFile=locationcommand line (V8.7 and later)
define(`ALIAS_FILE',`location')   ← mc configuration (V8.7 and later)
OAlocationconfiguration file (deprecated)
-oAlocationcommand line (deprecated)

The location is an argument of type string and can be an absolute or a relative pathname. A relative path (such as ../aliases) can be used for testing but should never be used in the production version of your sendmail.cf file. To do so opens a security hole. Such a path is interpreted by sendmail as relative to the queue directory.

This option can be used to change the name of the aliases file (a possible consideration for security). If you change the location or name ...

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.