Article View: news.software.readers
Article #20571How to get slrn to accept mail aliases
From: Felix von Leitner
Date: Sat, 13 Apr 1996 00:00
Date: Sat, 13 Apr 1996 00:00
52 lines
2010 bytes
2010 bytes
Hi folks,
I asked John some time ago for e-mail aliases. But since the Mail
Reader I use (ELM) does not use the standard mail aliases from .mailrc,
adding ELM aliases to slrn would have been a kludge, and would not have
satisfied me either.
So I hacked my own solution. It works like this.
I have configured vim (vi improved, a very cool vi clone, can be
obtained from ftp://ftp.prz.tu-berlin.de/pub/unix/editors/vim/) to
automatically pipe the header of the mail through expandmail� a small
perl script:
autocmd BufRead .letter 1,/^$/!expandmail
... and this is expandmail:
---
#!/usr/bin/perl
open(ALIASES,$ENV{"HOME"} . "/.elm/aliases.text")
or die "cannot open ~/.elm/aliases.text\n";
while (<ALIASES>) {
($alias,$tmp,$email) = (m/(.*) = (.*) = (.*)/);
$last="";
if (($last,$tmp2) = ($tmp =~ m/(.*); (.*)/)) {
$comment="";
($first,$comment) = ($tmp2=~m/(.*), (.*)/) or $first=$tmp2;
} else {
$last=$tmp; $comment=""; $first="";
}
$aliases{$alias} = "$first $last <$email>";
}
close(ALIASES);
while (<>) {
foreach $i (keys %aliases) {
s/([\s,])$i([\s,])/$1$aliases{$i}$2/;
}
print;
}
---
Tell you what? It works! ;) I figured some other folks might have had
the same problem. This is public domain. John, if you like, you can
add it to the slrn contrib section.
Felix
Technical Details
Message-ID:
<slrn4mu7f3.96.leitner@xorn.prz.tu-berlin.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <slrn4mu7f3.96.leitner@xorn.prz.tu-berlin.de> Subject: How to get slrn to accept mail aliases Date: Sat, 13 Apr 1996 00:00:00 +0000 From: leitner@xorn.prz.tu-berlin.de (Felix von Leitner) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 147232090 Content-type: text/plain; charset=iso-8859-1 Organization: PRZ/TU-Berlin Mime-version: 1.0 Reply-to: leitner@prz.tu-berlin.de Newsgroups: news.software.readers