Article View: news.software.nn
Article #6731Re: (Q) setting mailer -> elm (here's a SOLUTION)
From: Robert Joop
Date: Sat, 12 Nov 1994 00:32
Date: Sat, 12 Nov 1994 00:32
221 lines
6460 bytes
6460 bytes
tim@maths.tcd.ie (Timothy Murphy) writes:
>I carried out the instructions in the FAQ, adding
>set mailer nn_elm
>to .nn/init, putting the nn_elm script in my path
>(and also in .nn), etc,
>but it had no discernible effect.
>I'm not quite clear what the intended effect is?
>I had assumed that when I replied to a posting
>I would go into elm.
>Any suggestions gratefully received.
a lot of people seem to have problems with nn_elm. i stopped using it a lot
of years ago and wrote my own version called nnelm. it is written in perl
(both perl 4 and 5 work) and doesn't call elm at all. it just uses the elm
alias database. it's appended below.
look at the file's beginning since you may need to adjust your ~/.nn/init
and some paths in nnelm itself.
best,
rj
#!/bin/sh
# This is a shell archive (produced by shar 3.52.3)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
# made 11/12/1994 00:26 UTC by rj@rainbow
# Source directory /home/rainbow/rj/.rm
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 3237 -rwxrwxr-x nnelm
#
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
shar_touch=touch
else
shar_touch=:
echo 'WARNING: not restoring timestamps'
fi
rm -f 1231235999 $$.touch
#
# ============= nnelm ==============
if test -f 'nnelm' && test X"$1" != X"-c"; then
echo 'x - skipping nnelm (File already exists)'
else
echo 'x - extracting nnelm (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'nnelm' &&
#!/usr/local/bin/perl
# File: nnelm
# Purposes:
# - expand elm aliases
# - transform to mail-safe encoding
# nnelm's behaviour can be influenced by specifying an X-nnelm: header
# with the following options:
# ascii text is ASCII, don't encode
# noenc don't encode (assumes 8bit clean channel)
# qp convert to quoted-printable
# b64 convert to base64
# This version doesn't use elm or fastmail to actually send the mail
# An elm utility is used to expand aliases only.
# � 1993, 1994 by Robert Joop <rj@rainbow.in-berlin.de>
$version = '3.1.3';
# Put the following line into your ~/.nn/init:
# set mailer nnelm
# The line
# unset mailer-pipe-input
# is *not* needed.
# This program automatically generates a Bcc: to oneself that can be
# redirected using procmail; put something like the following into your
# ~/.procmailrc:
# :2
# ^X-Mailer: nnelm
# ^From: rj
# nn-sent
# (you've got to replace `rj' with your userid.)
X
# --- configuration: ---
X
# command that expands elm aliases:
$expand = '/usr/local/bin/checkalias';
$commatospace = 1; # checkalias doesn't like commas :-(
X
$charset = 'ISO-8859-1';
X
# MIME encoding:
$encoding = 'quoted-printable';
# command that generates MIME $encoding:
if ($ENV{'DOMAIN'} eq 'tubcs')
{
X $encoder = '/usr/elm/bin/mmencode';
}
else
{
X $encoder = '/usr/local/bin/mmencode';
}
%encoders = ('quoted-printable', "$encoder -q", 'base64', "$encoder -b");
$encode = 1;
$encoding = 'quoted-printable';
X
# MTA:
$sendmail = '/usr/lib/sendmail -t';
X
$tmp = "/tmp/nnelm.$$";
X
# --- let's do it! ---
X
open (TMP, "> $tmp");
X
$hdr = '';
hdr_line: while (<>)
{
X if ((/^$/ || !/^[ \t]/) && $hdr ne '')
X {
X # process header line:
X if ($hdr =~ /^(X-)?nnelm:/i)
X {
X $hdr =~ s/^(X-)?nnelm:\s*//i;
X @args = split (/[\s,]+/, $hdr);
X foreach $arg (@args)
X {
X if ($arg eq 'ascii')
X {
X $encode = 0;
X $encoding = '7bit';
X $charset = 'US-ASCII';
X }
X elsif ($arg eq 'noenc' || $arg eq 'no')
X {
X $encode = 0;
X $encoding = '8bit';
X }
X elsif ($arg eq 'qp' || $arg =~ /^quote/)
X {
X $encode = 1;
X $encoding = 'quoted-printable';
X }
X elsif ($arg eq 'b64' || $arg =~ /^base/)
X {
X $encode = 1;
X $encoding = 'base64';
X }
X }
X }
X else
X {
X foreach $key (('To','Cc','Bcc','Reply-To'))
X {
X if ($hdr =~ /^$key: /i)
X {
X $hdr =~ s/^$key: //i;
X $hdr =~ s/,/ /g if $commatospace;
X $hdr = `$expand "$hdr"`;
X $hdr =~ s/^Expands to: (\n\t)?//i;
X print TMP "$key: $hdr";
X $hdr = '';
X goto start;
X }
X }
X print TMP "$hdr";
X $hdr = '';
X }
X }
start:
X last if /^$/;
X $hdr .= "$_";
}
print TMP "Bcc: ", (getpwuid ($<))[0], " (instead of writing into =sent)\n";
print TMP "X-Mailer: nnelm $version (c) 1993, 1994 <rj\@rainbow.in-berlin.de>\n";
X
print TMP "MIME-Version: 1.0\n";
print TMP "Content-Type: text/plain; charset=$charset\n";
print TMP "Content-Transfer-Encoding: $encoding\n";
print TMP "\n";
X
if ($encode)
{
X close (TMP);
X $encoder = $encoders{$encoding};
X open (QUOTE, "| $encoder >> $tmp");
X print QUOTE while (<>);
X close (QUOTE);
}
else
{
X print TMP while (<>);
X close (TMP);
}
X
open (TMP, "< $tmp");
open (SENDMAIL, "| $sendmail");
while (<TMP>)
{
X s/^\.$/. /;
X print SENDMAIL;
}
close (SENDMAIL);
unlink ("$tmp");
SHAR_EOF
$shar_touch -am 1030133894 'nnelm' &&
chmod 0775 'nnelm' ||
echo 'restore of nnelm failed'
shar_count="`wc -c < 'nnelm'`"
test 3237 -eq "$shar_count" ||
echo "nnelm: original size 3237, current size $shar_count"
fi
exit 0
--
__________________________________________________
Robert Joop
rj@{rainbow.in-berlin,fokus.gmd,cs.tu-berlin}.de
s=joop;ou=fokus;ou=berlin;p=gmd;a=d400;c=de
Technical Details
Message-ID:
<3a12ek$k2e@rainbow.in-berlin.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!pipex!uunet!Germany.EU.net!netmbx.de!unlisys!rainbow.in-berlin.de!rainbow.in-berlin.de!not-for-mailReferences:
<39e36m$gp8@hamilton.maths.tcd.ie>Show Full Headers
Complete Article Headers
Message-ID: <3a12ek$k2e@rainbow.in-berlin.de> Subject: Re: (Q) setting mailer -> elm (here's a SOLUTION) Date: Sat, 12 Nov 1994 00:32:20 +0000 From: rj@rainbow.in-berlin.de (Robert Joop) References: <39e36m$gp8@hamilton.maths.tcd.ie> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!pipex!uunet!Germany.EU.net!netmbx.de!unlisys!rainbow.in-berlin.de!rainbow.in-berlin.de!not-for-mail Newsgroups: news.software.nn Lines: 221 NNTP-Posting-Host: rainbow.in-berlin.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Keywords: news mail nn elm