Welcome to WebmasterWorld Guest from 54.204.165.156

Forum Moderators: bakedjake

setting 'from' when sending mail from shell

When sending an email from command line or shell, can I set 'from'?

   
6:21 pm on Nov 5, 2002 (gmt 0)

10+ Year Member



I have a script that backups a database, gzips it, moves it, and sets some chmod permissions. Then, a copy of the archive is mailed to me. But the 'from' email address is always set to root. I'd like to change it, but I don't see a parameter to set it. Has anyone come up with something?
7:01 pm on Nov 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From 'man sendmail':

-f <address>
Set the address of the sender of a locally-generated message.
This option can normally be used only by root or the Exim user
or by one of the configured trusted users. However, anyone may
use it when testing a filter file with -bf or when testing or
verifying addresses using the -bt or -bv options. In other
cases, the sender of a local message is always set up as the
user who ran the exim command, and -f is ignored, with one
exception. If the special setting -f <> is used by an untrusted
user, it does not affect the sender for the purposes of managing
the Sender: and From: headers, but it does have the effect of
causing any SMTP transmissions to be sent out with ...
7:06 pm on Nov 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



58sniper - the parameters are different based on the Unix platform you are using and whether you are using mail, mailx, or sendmail
7:54 pm on Nov 5, 2002 (gmt 0)

10+ Year Member



My mistake. I'm using mail. Just a simple command line send of a file. It's no big deal, really. Just an aestetics thing....

If it can't be done, I'll live with it.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month