reporting BTS spam easily from Mutt
In case it's useful to anyone, here's a quick hack I put together for
easy BTS spam reporting from mutt.
Firstly a keybinding for .muttrc:
macro index B "<enter-command>unset wait_key\n<pipe-entry>bugspam\n<enter-command>set wait_key\n<delete-message>"
macro pager B "<enter-command>unset wait_key\n<pipe-entry>bugspam\n<enter-command>set wait_key\n<delete-message>"
Secondly, a script called bugspam which goes somewhere in $PATH:
#!/usr/bin/perl
# Read message on stdin, get Bug#nnn from subject line then call
# "bts reportspam" to submit a spam report
$bug = 0;
while(<>) {
if (m/^Subject: (?:\[.*\])?\s*Bug#(\d+): /) {
$bug = $1;
last;
}
}
if ($bug) {
print "Reporting spam in bug $bug\n";
system "bts reportspam $bug";
} else {
print "Bug number not found from subject line\n";
}
(And install devscripts to get the "bts" program.)
Now, hit B on bug spam and be merry.
Future enhancements might include reopening of occasional nnn-done@bugs
spam incidents.
I suppose the trend these days would be to blog this rather than post,
but I don't have one.
Hamish
--
Hamish Moffatt VK3SB <hamish@debian.org> <hamish@cloud.net.au>
Reply to: