mailx OR sendmail

 
nedz
Occasional Contributor

mailx OR sendmail

Friends out there -

As a user - I su - (to root) knowing the root passwd - I then do a mailx and will show that it came from user and NOT AS ROOT

Is there a way to change that so it would show the sender as ROOT -
5 REPLIES 5
Arturo Galbiati
Esteemed Contributor

Re: mailx OR sendmail

Hi,
you can change the sender by mailx using -r options:

mailx -r root -s "subject" a@b.c
HTH,
Art
Peter Godron
Honored Contributor

Re: mailx OR sendmail

Hi,
please read this earlier thread:
"Sending emails from root after "su -"
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=778737

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.

So far you have not awarded any points !
Oviwan
Honored Contributor

Re: mailx OR sendmail

Hey

the same for sendmal:

$cat <>mail
> from: sender@blah.blubb
> subject: Test
> Msg
> EOF

$sendmail your_email@blah.blubb < mail

Regards
Steven E. Protter
Exalted Contributor

Re: mailx OR sendmail

Shalom,

You could use a sendmail script and change the sender to anybody you want.

http://www.hpux.ws/mailfile2

Thats a bit elaborate though.

You could try setting up /etc/aliases on the system and give root an alias to another user or email address

root: nedz@your.net

newaliases command will put that into effect.

Note that mailx uses sendmail as a transport by default so it really doesn't matter wheter you use elm, mailx mail or sendmail itself.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Peter Godron
Honored Contributor

Re: mailx OR sendmail

Hi,
have you had any progress with this problem ?

If this is fixed, could you please complete the thread by awarding points to helpful answers and summarising the solution for you.

http://forums1.itrc.hp.com/service/forums/helptips.do?#33 shows how to reward any useful answers given to your questions.