CLI Mail as another user.(Bash script)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx -t < mail.txt


Content of mail.txt:

From: Account Creator <account_creator@xxxxxxxxxxxxx>
To: danieyek@xxxxxxxxxxxxxxx
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@xxxxxxxxxxxxx (notice
dash, instead of dot) as From: address, sendmail would hang for a long
time.

-- 
Daniel.


                             From: 
Ow Mun Heng <Ow.Mun.Heng@xxxxxxx>
                         Reply-To: 
For users of Fedora Core releases
<fedora-list@xxxxxxxxxx>
                               To: 
Fedora-List <fedora-list@xxxxxxxxxx>
                          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@xxxxxxxxxxxxx instead of
root@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 





[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux