Lua is run before the download rules, but any changes to the headers aren't processed until afterwards. (Download rules, Lua scripts & DLL plugins all build up a table of actions to perform on the message, then, after they're all finished, the actions take place)
So, normally you'd want Lua to do any redirection & deletion, rather than doing part with Lua and part with download rules.
I'll put a suitable script up here later today.
| Paul Smith
PSCS Technical Support |