Patrick R. Wade wrote:
Garl Grigsby wrote:
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.
I finally figured out the correct incantation to get most of
genericstable working lastnight. The real killer is that it only works
if your message is sent with no FROM: designation. Like this:
echo "Test message" | sendmail [EMAIL PROTECTED]
When you do that you get something that looks like this:
<snip>
Received: from srv1.mylocaldomain.loc (localhost.localdomain [127.0.0.1])
by srv1.mylocaldomain.loc (8.13.1/8.13.1) with ESMTP id xxx
for <[EMAIL PROTECTED]>; Mon, 10 Apr 2006 16:57:16 -0700
Received: (from [EMAIL PROTECTED])
by srv1.mylocaldomain.loc (8.13.1/8.13.1/Submit) id xxx
for [EMAIL PROTECTED]; Mon, 10 Apr 2006 16:57:16 -0700
Date: Mon, 10 Apr 2006 16:57:16 -0700
From: [EMAIL PROTECTED]
Message-Id: <[EMAIL PROTECTED]>
Bcc:
Test message
So you can still see where it originated from, but anybody responding to
it gets a real email address. Now I just need to figure out how to get a
subject to the message... and a few other niceties.
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
Cool. That's what I was looking for, and kind of expected to find in a
command line client. Google wasn't much help though... I'll have to look
into this.
# 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).
Doh! I should have thought of using su... Damn that was dumb.
_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug