At work, I wrote some bash scripts with proccgi to make a form that we enter some information into, then it pulls other data from our ticketing system. The script then assembles an email and sends it to certain people. Who it gets sent to is determined by a selectbox in the form. To increase security, the people who get our emails will now only accept these emails from certain addresses. Is there a way to send emails from the command line that let me specify who the sender is? Or is this something I have to configure in the exim setup? Originally I just used a "heredocument" to pipe the body of the email to the mail command. Now I'm trying to pipe the text of the email to /usr/lib/sendmail -t with the FROM, TO, etc lines being specified, but they still detect it being sent by the webserver user, which they reject.
This form saves us a lot of time typing, any tips will be appreciated.