Garl Grigsby wrote:
Is there any way, either somewhere in sendmail or from the command line,
to have mail sent from root appear to come from another user? I've got a
bunch of jobs that run as root and send out status messages via root.
I'd like them to appear to come from another address. I'm currently
using the 'mail' command to send the messages.
Are you using Sendmail? Some MTAs (notably sSMTP) support a
reverse-aliases file. Googlemancy suggests Sendmail may do this with
the genericstable, but i haven't used one on my Sendmail setups.
As to clients and command lines, nail (a command-line mail client that
can do MIME) supports a -r option to specify From. As you're running
jobs as root, you could also do
# su user -c 'fortune `# or other commands` |
mail -s "example message `date +%s`" [EMAIL PROTECTED]'
(I.e., the command inside the 'quotes' is executed as "user").
(And `# this` or $(# this) is the best i've come up with for bash
in-line comments).
--
On two occasions I have been asked [by members of Parliament!], 'Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able rightly to apprehend the kind of
confusion of ideas that could provoke such a question.
-- Charles Babbage
_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug