Article View: news.software.readers
Article #27922Re: Sharing mail aliases between slrn and a mailer
From: Randall Hopper
Date: Mon, 25 Nov 1996 00:00
Date: Mon, 25 Nov 1996 00:00
77 lines
2989 bytes
2989 bytes
Louis-David Mitterrand <mito@retriever.qc> wrote:
|I'm using slrn which is a great program. Often I am forwarding funny (or
|discusting) articles to friends (or family) and I have to enter their
|full email even if an alias is already defined in my mail config file.
|
|Is there a way to make slrn aware of these aliases and/or easily insert
|them from a menu?
I had the same request, and it was suggested to me that I write a
script and hang it off sendmail_command. I did that, so here it is in the
hopes it may help. Note that this resolves ELM aliases. Assuming you use
ELM, you'll want to change the paths at the top of the script.
...would be a lot nicer if slrn supported an alias file though.
(Maybe it does by now. It's been a few weeks since I pulled the latest
version).
Randall Hopper
rhh@ct.picker.com
set sendmail_command "/net/elmer.ct/client/rhh/.slrn/slrn-mailagent"
#!/opt/bin/perl
#
# SCRIPT : slrn-mailagent
# PURPOSE: SLRN sendmail_command utility emulating the sendmail
# interface, but which in addition handles ELM alias expansion
# of the To: and Cc: lines
# AUTHOR : Randall Hopper (10/14/96)
#
$ELMALIAS = "/opt/elm/bin/elmalias";
$PRLONG = "/opt/elm/lib/prlong";
$SENDMAIL = "/usr/lib/sendmail -oi -t -oem -odb";
open ( STDOUT, "| $SENDMAIL" ) || die "Can't open pipe to mail agent\n";
while (<>) {
if ( /^(To|Cc): (.*)/ ) {
$header = $1;
@recip = split(', *', $2);
$line = $_;
$pid = open( OUT, "-|" );
die "Failed to fork to run elmalias subprocess\n" if ( !defined($pid) );
exec $ELMALIAS, '-ne', @recip if ( $pid == 0 );
wait();
die "elmalias failed: status = $?\n" if ( $? != 0 );
@recip = <OUT>;
close(OUT);
@recip = map( (chomp( $_ ) ? $_ : $_), @recip );
$recip = join( ",", @recip );
system( "echo \"$recip\" | tr , '\012' | $PRLONG -1 \"$header: \" -f ', ' -w 75" );
}
else {
print $_;
}
}
close( STDOUT );
exit 0
--
_____________________________________________________________________________
Randall Hopper (AA8VB) | Picker International, CT Visualization
rhh@ct.picker.com | FAX: (216) 473-7098
*** WINDOWS, from the folks who brought you EDLIN ***
Technical Details
Message-ID:
<57c69m$h1s@news.multiverse.com>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-mailReferences:
<slrn59gosh.25r.mito@retriever.qc>Show Full Headers
Complete Article Headers
Message-ID: <57c69m$h1s@news.multiverse.com> Subject: Re: Sharing mail aliases between slrn and a mailer Date: Mon, 25 Nov 1996 00:00:00 +0000 From: rhh@ct.picker.com (Randall Hopper) References: <slrn59gosh.25r.mito@retriever.qc> 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: 200817507 Organization: Picker International, Inc. Newsgroups: news.software.readers