I've run into an issue with a piece of third party software that creates it's own alias file to be used by sendmail. Looking through the configuration options, google, and the man pages it seems like I can only define one alias file which means either I only get all the software's addresses or all of the local aliases.

I have tried appending my own entries to the software's alias file but it gets rebuilt everytime there is a change of addresses and my entries get blown away.

My question is, is there a way to define addional alias files in sendmail.mc or to include additional addresses from another file?

3 Answers 3


If you read the Sendmail documentation, you'll find:

ALIAS_FILE  [/etc/mail/aliases] The location of the text version of the
alias file(s). It can be a comma-separated list of names (but be sure you
quote values with commas in them -- for example, use define(`ALIAS_FILE',
`a,b') to get "a" and "b" both listed as alias files; otherwise the
define() primitive only sees "a").

So, you can edit your sendmail.mc file to use a common-delimited list of alias files, and then regenerate your sendmail.cf. And restart Sendmail.


You can't have a second aliases file, but you can include a file using the syntax

    :include: /path/name 
So define all your aliases in your aliases file, and then include the one created by your software.

  • I tried add the following line exactly to my /etc/aliases file: ":include: /etc/mail/list_aliases" and ran newaliases. It gave me the following error: "/etc/aliases: line 99: :include: /etc/mail/list_aliases... illegal alias name" Dec 3, 2009 at 16:03
  • After looking up the syntax it seems that the :include: statement is a destination for an alias but can not define aliases themselves Dec 3, 2009 at 16:05

Aliases of the form

alias     :include:/path/to/some/alias_file

take their email targets from the contents of alias_file. Put each email address on a separate line.

For instance, if /usr/local/etc/my_list contains a list of addresses that you want to alias as "myfriends", you would use this entry in /etc/aliases:

myfriends     :include:/usr/local/etc/my_list

with my_list containing legal email addresses one per line like this

[email protected]
[email protected]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .