Mark spam with mutt on Debian's mailing lists

Kumar Appaiah proposed a solution on the debian-devel mailing list which can be extended a bit to work only on mails from Debian's lists.

message-hook '~A' 'bind index,pager S noop'
message-hook '~h "^List-Id: <[^ \t]+\.lists\.debian\.org>"' 'macro index,pager S "<bounce-message>\n" "report list spam to debian"'

Put it in you .muttrc and restart mutt (or reload your .muttrc).

What does it do?

Add a message-hook for all messages matching the regex in a List-ID header line. The hook sets a macro for index and pager to bounce the message to the report-listspam address when such a message is opened - being on the message in the index isn't sufficient. I bound the macro here to 'S' which is my standard macro for spam. This way I don't care where the message comes from, I just use my usual spam report button and mutt does the rest: if it's from a Debian list, report it, otherwise do whatever else mutt would do with your spam.

For your convenience there is an added hook that unbinds the key again if you view a regular message so you don't accidently bounce messages to the report-listspam address that aren't from a list. Again, the hooks only jump in when you actually view messages and not just when you are on them in the pager.