CLI Mail as another user.(Bash script)

Daniel Yek danieyek at alumni.washington.edu
Tue Aug 10 20:39:58 UTC 2004


Did you say you CAN'T get it to work, or you CAN?

Wouldn't the following do the job? You don't need trusted user (in fact,
I have no idea what that means; obviously my knowledge is limited;) for
this to work.

Only setting the From: line in the email header:
/usr/sbin/sendmail -t < mail.txt

Set both From: email header and the envelop sender email address (to get
through email list, etc.):
/usr/sbin/sendmail -faccount_creator at real-host.com -t < mail.txt


Content of mail.txt:

From: Account Creator <account_creator at real.host.com>
To: danieyek at haiou.olywa.net
Subject: CLI Mail as another user (Bash script)
Date: Tue, 10 Aug 2004 13:30:00 -0800
Content-Type: text/plain; charset=us-ascii

This is the email body; this email pretends to be sent from Account
Creator.



Note: For unknown reason, if I use account_creator at real-host.com (notice
dash, instead of dot) as From: address, sendmail would hang for a long
time.

-- 
Daniel.


                             From: 
Ow Mun Heng <Ow.Mun.Heng at wdc.com>
                         Reply-To: 
For users of Fedora Core releases
<fedora-list at redhat.com>
                               To: 
Fedora-List <fedora-list at redhat.com>
                          Subject: 
CLI Mail as another user.(Bash
script)
                             Date: 
Thu, 05 Aug 2004 17:47:12 -0700
Hi all,

        I'm writing a bash script in which I would like to send emails
out. 

This would be using the root account, however, I would like for the
email to _appear_ to come from another user. (so that when users reply
to the email, they will get say account_creator at real-host.com instead of
root at localhost) which will bounce.

I noticed evolution uses sendmail -f. I can seem to get this to work
(since it needs "trusted users" right?)

Any other method??

-- 
Ow Mun Heng
Fedora GNU/Linux Core 2 on D600 1.4Ghz CPU kernel
2.6.7-2.jul1-interactive 
Neuromancer 17:44:41 up 3:31, 8 users, load average: 1.44, 0.78, 0.66 







More information about the fedora-list mailing list