mailx

Hi,

Thanks in Advance !!

I have a korn script which is used to mail the reports to the users.
I'm using the mailx utility. The uid used for running the script is "cronman",
so the mails recieved by users are id FROM:"cronman".

Now i want to change the FROM address to another user name say "deshp"
in the same script.

How do i do this. Is there any other mail utility which are provide me the result.

The FROM: part is created by the sendmail or the mailx utility to prevent one user from pretending to be another. This is called spoofing. Spoofing the return address requires intervening with smtpd (or a pop3 server process) or rewriting mailers.

Reasonable choices:

  1. put "FROM deshp" at the start of the subject line
  2. have the job creating the mail setuid to deshp to change effective uid.

I do not know of mail utility that will do this without you having privilege to setuid. If you could do this, you could send emails to employees and pretend you are the CEO of the company.

Try the option -r, for example:

mailx -c $CC -r $FROM -s $SUBJECT

I'm using this for automatic script that will send mail for requesting to run job. The requestor will be changed according to the date that person is responsible for..

Good Luck !! :slight_smile: