Find the answer to your Linux question:
Results 1 to 2 of 2
I have a bash script that runs as root and sends an email using sendmail When I receive the message, it comes from root. Is it possible to send the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2011
    Posts
    1

    Sending SENDMAIL message as another user.


    I have a bash script that runs as root and sends an email using sendmail

    When I receive the message, it comes from root. Is it possible to send the message from as my user account instead of root?

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758
    Quote Originally Posted by dleblanc View Post
    I have a bash script that runs as root and sends an email using sendmail

    When I receive the message, it comes from root. Is it possible to send the message from as my user account instead of root?
    Something like this - worked for me.
    mail -s "Test mail " -a structure.tgz toaddress@site.com -- -f fromaddr@site.com < body.txt
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •