OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Change the "From:" address in Unix "mail"

  • Thread starter Thread starter Chris Conway
  • Start date Start date
C

Chris Conway

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

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).

[EDIT]


$ mail -s Testing [email protected]
Cc:
From: [email protected]

Testing
.


yields


Subject: Testing
To: <[email protected]>
X-Mailer: mail (GNU Mailutils 1.1)
Message-Id: <E1KdTJj-00025z-RK@localhost>
From: <chris@localhost>
Date: Wed, 10 Sep 2008 13:17:23 -0400

From: [email protected]

Testing


The "From: [email protected]" line is part of the message body, not part of the header.
<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 [email protected]
Cc:
From: [email protected]

Testing
.
</pre>

<p>yields</p>

<pre>
Subject: Testing
To: <[email protected]>
X-Mailer: mail (GNU Mailutils 1.1)
Message-Id: <E1KdTJj-00025z-RK@localhost>
From: <chris@localhost>
Date: Wed, 10 Sep 2008 13:17:23 -0400

From: [email protected]

Testing
</pre>

<p>The "From: [email protected]" line is part of the message body, not part of the header.</p>
Continue reading...
 
Top