/usr/bin/ldapsearch -x -ZZ -w "$LDAPPASS2" -b "dc=comain,dc=com" -D cn=user,ou=agents,dc=domain,dc=com "cn=$@" 2>&1 | /myscripts/pipe-to /bin/mail -s 'New list '$@' created' firstname.lastname@example.org
I'm using the above line in a bash script that sends the results of an ldapsearch to my email address. The address comes with the From: address set to the user that script is executed as. How would I change the above line so that I can specify the From: address of the email manually?
I tried man mail, and google, but I wasn't able to find a way to set the from address using /bin/mail. I found one google link that suggested I could set the from address by appending '-- -f email@example.com
' to the above line, but that didn't seem to work.