Operating System - HP-UX
1748180 Members
4190 Online
108759 Solutions
New Discussion юеВ

Re: Mail sent as daemon needs to be as someone else

 
SOLVED
Go to solution
Michael Resnick
Advisor

Mail sent as daemon needs to be as someone else

Hello -

I have a ksh script running as daemon which sends out email. I'd like the email to be sent as someone else, like appadmin. Can this be done?

(The email is sent as daemon@blah.blah.com. I'd like it to be appadmin@blah.blah.com.)

Thanks!

mike
3 REPLIES 3
Rajeev  Shukla
Honored Contributor
Solution

Re: Mail sent as daemon needs to be as someone else

Yes you can do that, it is possible.
If its sendmail use -f option (from address) and if you are using mailx then use -r option
have a look at the man pages of both the commands.
Pratyush Paul_1
Valued Contributor

Re: Mail sent as daemon needs to be as someone else

Mike,

here are the option to do this.

if you are using sendmail

sendmail -f appadmin@blah.com userid@domain.com

if you are using mailx use the -r option.

or what you can do is

mailx -s "mail from appadmin" userid@domain.com

You will have a subject line in your mail "mail from appadmin"

thanks

Pratyush
Die Hard
Steven E. Protter
Exalted Contributor

Re: Mail sent as daemon needs to be as someone else

Just as another option, I'm attaching a sendmail script that can do things like attachments(this functionality is easily commented out).

It handles to and from address quite nicely.

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