qmail-scanner 1.20rc2 contains this functionality itself, using nearly the same implementation as me. Instead of using this patch, please upgrade.