<p>Sending a message from the Unix command line using <code>mail TO_ADDR</code> results in an email from <code>$USER@$HOSTNAME</code>. Is there a way to change the "From:" address inserted by <code>mail</code>?</p>

<p>For the record, I'm using GNU Mailutils 1.1/1.2 on Ubuntu (but I've seen the same behavior with Fedora and RHEL).</p>

<p>[EDIT]</p>

<pre>
$ mail -s Testing chris@example.org                                                                  
Cc: 
From: foo@bar.org

Testing
.
</pre>

<p>yields</p>

<pre>
Subject: Testing
To: &lt;chris@example.org&gt;
X-Mailer: mail (GNU Mailutils 1.1)
Message-Id: &lt;E1KdTJj-00025z-RK@localhost&gt;
From: &lt;chris@localhost&gt;
Date: Wed, 10 Sep 2008 13:17:23 -0400

From: foo@bar.org

Testing
</pre>

<p>The "From: foo@bar.org" line is part of the message body, not part of the header.</p>

Here are some options:
If you have privelige enough, configure sendmail to do rewrites with the generics table
Write the entire header yourself (or mail it to yourself, save the entire message with all headers, and re-edit, and send it with rmail from the command line
Send directly with sendmail, use the "-f" command line flag and don't include your "From:" line in your message
These aren't all exactly the same, but I'll leave it to you look into it further.
On my portable, I have sendmail authenticating as a client to an outgoing mail server and I use generics to make returning mail come to another account.  It works like a charm.
I aggregate incoming mail with fetchmail.