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 ...
  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,568
    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
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

Posting Permissions

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