Operating System - HP-UX
1822448 Members
2509 Online
109642 Solutions
New Discussion юеВ

Re: automatically forward root emails to an user

 
Hong Zhou
Occasional Advisor

automatically forward root emails to an user

Hello,

I am having HP-UX 11i on Rp5405 box. Does anyone know how to setup to forward root emails to a regular user whenever a new email received by root? I can't find a .forward file under /.

Thanks for your help,

Hong
New Admin to HP-UX 11.0 admin
8 REPLIES 8
Doug Burton
Respected Contributor

Re: automatically forward root emails to an user

Edit the /etc/mail/aliases file and add:

root : user1,user2@someplace.com

then run "newaliases".
James R. Ferguson
Acclaimed Contributor

Re: automatically forward root emails to an user

Hi Hong:

You must create a '.forward' file if that's the method you want to use. Otherwise, you can setup sendmail aliases in '/etc/mail/aliases'. See the commentary witin the file.

To simply use a '.forward' as you asked, create the file owned by 'root' with readonly permissions to everyone:

# cat /root/.forward
hongzhou
hongzhou@yourcompany.org

Regards!

...JRF...
Pete Randall
Outstanding Contributor

Re: automatically forward root emails to an user

That gets added under the "# Local aliases" section, by the way.


Pete

Pete
Hong Zhou
Occasional Advisor

Re: automatically forward root emails to an user

Thanks so much for all of the inputs.

I tried both methods. Added a line in /etc/mail/aliases file. How to run the new aliases? It is not excutable file, should I add the permissin first thrn run it?

I can find out if .forward work tomorrow.

Thank,

Hong
New Admin to HP-UX 11.0 admin
James R. Ferguson
Acclaimed Contributor

Re: automatically forward root emails to an user

Hi (again) Hong:

> How to run the new aliases?

As root:

# /usr/sbin/newaliases

Regards!

...JRF...
Geoff Wild
Honored Contributor

Re: automatically forward root emails to an user

Just enter: newaliases

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Hong Zhou
Occasional Advisor

Re: automatically forward root emails to an user

Thanks a lot. "newaliases" was run, but got a Warning message like this: "local hostname is not qualified. fix $j in config file".

What should I do now?

Hong
New Admin to HP-UX 11.0 admin
James R. Ferguson
Acclaimed Contributor

Re: automatically forward root emails to an user

Hi Hong:

Read the comments regarding "$j" in '/etc/mail/sendmail.cf'. You need a FQDN. Sendmail and DNS are intimately intwined.

Regards!

...JRF...