My take on «Moderating Majordomo Lists with Vim and Mutt»
What I do instead is have these lines in .mutt/muttrc:
# Useful macros for Majordomo list administration macro pager R "|~/bin/majordomo-reject\nd" "Majordomo reject" macro pager A "|~/bin/majordomo-accept\nd" "Majordomo accept"
And then majordomo-accept and majordomo-reject are symlinks to a Perl program that looks like this:
#!/usr/bin/perluse warnings; use Net::SMTP;
if ($0 =~ /accept/) { $action = "accept"; $fullaction = "Accepting"; } elsif ($0 =~ /reject/) { $action = "reject-quiet"; $fullaction = "Rejecting"; }
die "No mode defined" unless defined $action;
while (<>) { if (/^Subject: ([0-9A-Z-]{14}) : (CONSULT|REMINDER)/) { $token = $1; last; } }
die "No token defined" unless defined $token;
$smtp = Net::SMTP->new('localhost') or die "new: $!";
$smtp->mail('alvherre@surnet.cl'); $smtp->to('majordomo@postgresql.org');
$smtp->data; $smtp->datasend(<<END_OF_MAIL); From: Moderation Robot <alvherre\@alvh.no-ip.org> To: postgresql.org's Majordomo <majordomo\@postgresql.org> Subject: $fullaction token $token
$action $token END_OF_MAIL $smtp->dataend(); $smtp->quit;
The main upside to this approach is that I don't have to hit "reply" to the email; I can just hit "R" or "A" on the mutt message view.
