Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Sender

Status
Not open for further replies.

SpongeBob1

Programmer
Mar 1, 2002
49
US
Hi,

Does anyone know how to set the senders email address when using mail? Is there someway of doing this?

Thanks.
 
You can specify
From:
To:
Subject:

in the top of the message.

Robert Robert G. Jordan
Unix Sys Admin
Sleepy Hollow, Illinois U.S.A.
sh.gif


FREE Unix Scripts
 
Hi Robert,

What I am actually trying to do is as follows;
I am writing a script which sends email, this is fine. When I run it under my ID ( unix ) it sends the email from my email address ( unix ). This is fine, however if the ownership of the script is changed it sends the script from the owners unix email address. I still wish it to send the email from my account, is there a way to do this?

Thanks,
Bob.
 
I am by no means an email expert.
If you specify the FROM: field,
most email clients will show that from address
rather than the actual sender's address since
most email clients do not print the full email header
by defalut.

If you want to acutaly send email out as that user,
you will have to change to that user's id.

You may experiment running the script with the suid bit set
so that the script runs as and with the permissions of the
owner no matter who invokes it.
Check out the man page on chmod. An example is the
passwd program. It always runs as root no matter what
user invokes it. If I remember correctly, you should
be able to set it like this.

chmod 4755 script

Again, this is just a guess.

Robert
Robert G. Jordan
Unix Sys Admin
Sleepy Hollow, Illinois U.S.A.
sh.gif


FREE Unix Scripts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top