Per @mikemcquaid #25988 fix all the `brew uses lua` packages for lua 5.2
  Assuming 'fix those things to work with Lua 5.2' to mean fix the formulae to not
  break when 'lua' means lua 5.2 and not lua 5.1 rather than get ~25 patches merged
  upstream to 25 projects of varing degrees of decrepitude, I expect something
  like this should do it?

  Obviously (I hope) a drive by fix. I tested with, um, 'imapfilter'.
  But maybe the test bot can lend a hand there?