[Users] Quoting/escaping shell input within templates

Trevor Carey-Smith trev at highwater.co.nz
Fri Apr 5 03:23:03 CEST 2013

I have been using one of the nifty pipe commands in a reply template
like so:

  |p{echo '%t%c'|grep -o '[a-zA-Z]*@mydomain.com'}

to extract out the particular address at my domain that the email was
sent to.

Unfortunately, this goes wrong if the To: field contains single quotes,
a worse case scenario something like:

  To: "'Someone ; rm -rf ~/ ; '" <some at address.com>, <me at mydomain.com>

So, is there a better way to quote the %t field or some other way to do
what I want?


More information about the Users mailing list