Have you ever had the need to read standard input in a bash script, for example
Well i did when wrapping msmtp for use with mutt see the example bellow
1 2 3 4 5 6 7 8 9
I then setup mutt to use this as the sendmail binary
This basically reads, if im in the network 172.31 or 172.32 then run msmtp through tsocks if not then just run msmtp, this allowed me to use tsocks to proxyfy msmtp under certain circumstances. But i could also do other things like read the from header and switch the account msmtp uses to send the mail. It passes all standard input to the msmtp binary as well as all the command arguments passed to my sendmail.sh.
Although im sure other people can create more interesting uses.