Operating System - HP-UX
1827064 Members
4394 Online
109713 Solutions
New Discussion

Testing /etc/mail/aliases file

 
SOLVED
Go to solution
Joey Sta. Cruz III
Occasional Contributor

Testing /etc/mail/aliases file

Hi,

We are using "majordomo" as for our mailing list. I just added some majordomo aliases on our /etc/mail/aliases file.

Now my question is, how would I test any new entry on my /etc/mail/aliases file aside from sending out a test email? I know that we could telnet on port 25 to do some testing, unfortunately I dont know what syntax or commands to use.

Appreciate your help on this
Regards
Joey
3 REPLIES 3
Frederic Soriano
Honored Contributor
Solution

Re: Testing /etc/mail/aliases file

Hi Joey,

"EXPN" is the SMTP command you are looking for (used to *expand* an email alias key to its value), eg. if your /etc/mail/aliases file contains a line:

--snip--
owner-list: joey
--snip--

Then issuing "EXPN owner-list" on port 25 would give "joey", considering that EXPN keyword is not deactivated.

Complete SMTP command list can be obtained by entering keyword HELP. You can also issue "HELP EXPN" to get more info on the "EXPN" keyword.

I hope this helps !

Best regards,

Fred.
Bill Hassell
Honored Contributor

Re: Testing /etc/mail/aliases file

Using telnet is one way. Here's an example:

# telnet bambam 25
Trying...
Connected to e35.atl.hp.com.
Escape character is '^]'.
220 e35.atl.hp.com ESMTP Sendmail 8.9.3 (PHNE_18546)/8.8.6; Sat,
EXPN ROOT
250
QUIT
221 e35.atl.hp.com closing connection
Connection closed by foreign host.

Note that I've written the commands EXPN ROOT and QUIT in UPPERCASE for readability--sendmail (really: SMTP) accepts UPPER or lowercase.

There's also an even more useful (but little known) script called expand_alias. Give it any email address such as:

# expand_alias root@e35

Bill Hassell
Bill Hassell

If root has been forwarded to another node (as in this case), expand_alias will follow up to 26 levels of forwarding. As mentioned, this expn test works unless explicitly turned off in sendmail configs.


Bill Hassell, sysadmin
Steven Sim Kok Leong
Honored Contributor

Re: Testing /etc/mail/aliases file

Hi,

If you happen to be using MySQL with Sendmail, you can use the update-indices.pl script to fix a corrupted Sendmail aliases file.

update-indices.pl is also used in repairing a corrupted MySQL database as well.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com