I just copied the original script [1] from Redmine to my computer and am using that with minor modifications (shebang). It works fine.
[1] https://github.com/redmine/redmine/blob/master/bin/rails -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org