1829107 Members
2850 Online
109986 Solutions
New Discussion

Testing /etc/aliases

 
Patrick Ware_1
Super Advisor

Testing /etc/aliases

I was just curious about a way to test the /etc/aliases file, and if there was a specific command to execute after you do the newaliases command? I checked the man pages, and did not find what I needed to know.

Thanks in advance for your help!
3 REPLIES 3
Rick Garland
Honored Contributor

Re: Testing /etc/aliases

The /etc/aliases I have documentation in them that they are sendmail aliases.

!st off, I would check the /etc/mail/sendmail.cf file to see where it thinks the aliases file is. There will be a line that says "AliasFile=..."

Usually it is /etc/mail/aliases but check to be sure.

To activate the aliases file in sendmail issue the following command;
/usr/sbin/sendmail -bi

This will reread the aliases file and create a new aliases.db database file for sendmail to use. If there is a problem the output will let you know.

You can test after the sendmail -bi command. Just send a mail to the alias you created.

Devesh Pant_1
Esteemed Contributor

Re: Testing /etc/aliases

doing a sendmail -bi will work
If you do a man sendmail will provide you this info

thanks
DP
Ermin Borovac
Honored Contributor

Re: Testing /etc/aliases

Maybe you are looking for -bv option to sendmail.

-bv Verify names only; i.e, do not try to collect or deliver a
message. Verify mode is normally used for validating users
or mailing lists.

$ /usr/sbin/sendmail -bv nobody
/dev/null... deliverable: mailer *file*, user /dev/null

Also look into expand_alias(1).