Created
March 5, 2020 06:31
-
-
Save nasamuffin/cacedae420914ba91abfb04461618439 to your computer and use it in GitHub Desktop.
Message-Id -> Lore with mutt display_filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## (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