Skip to content

Instantly share code, notes, and snippets.

@nasamuffin
Created March 5, 2020 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nasamuffin/cacedae420914ba91abfb04461618439 to your computer and use it in GitHub Desktop.
Save nasamuffin/cacedae420914ba91abfb04461618439 to your computer and use it in GitHub Desktop.
Message-Id -> Lore with mutt display_filter
!/usr/bin/perl
my @message;
my $isGit = 0;
while (<>) {
push @message, "$_";
$isGit |= m|git\@vger.kernel.org|;
}
if ($isGit) {
foreach (@message) {
s|(^Message-Id: <(.*)>)|\1\nhttps://lore.kernel.org/git/\2|i;
# Mutt usually winds up wrapped at 100ch.
s|(.*\n)(.{100,})|\1(lore URL too long to display)|i;
}
}
print @message;
## (more muttrc here)
# Show the lines we care about in mails
ignore *
unignore From To Subject Cc Date Message-Id
hdr_order Date: From: To: Cc: Subject: Message-Id:
set display_filter="~/dotfiles/.mutt-message-id-to-lore.pl"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment