[comp.mail.elm] alias sharing...

wb8foz@mthvax.cs.miami.edu (David Lesher) (04/19/91)

Kim Storm has just released a nn patch that makes provision for
an external alias program.

I'd LOVE to be able to use my elm-defined alias file under nn.
Who will be the first to write the needed code????


(Me? C? You don't understand - we need functioning code ;-)

-- 
A host is a host from coast to coast.....wb8foz@mthvax.cs.miami.edu 
& no one will talk to a host that's close............(305) 255-RTFM
Unless the host (that isn't close)......................pob 570-335
is busy, hung or dead....................................33257-0335

syd@DSI.COM (Syd Weinstein) (04/19/91)

wb8foz@mthvax.cs.miami.edu (David Lesher) writes:
>Kim Storm has just released a nn patch that makes provision for
>an external alias program.

>I'd LOVE to be able to use my elm-defined alias file under nn.
>Who will be the first to write the needed code????
Who needs to write C code, just write a shell wrapper around
the "elm -c" command.

$ elm -c syd
Expands to: syd@dsi.com (Syd Weinstein)

Then just chop it using expr or sed to remove the stuff you don't
want, such as the Expands to: and the ( ) comment.
-- 
=====================================================================
Sydney S. Weinstein, CDP, CCP                   Elm Coordinator
Datacomp Systems, Inc.                          Voice: (215) 947-9900
syd@DSI.COM or dsinc!syd                        FAX:   (215) 938-0235

jaap@sequent.com (04/20/91)

In <1991Apr19.025634.11846@mthvax.cs.miami.edu> wb8foz@mthvax.cs.miami.edu (David Lesher) writes:

>Kim Storm has just released a nn patch that makes provision for
>an external alias program.
>
>I'd LOVE to be able to use my elm-defined alias file under nn.
>Who will be the first to write the needed code????
>
>
>(Me? C? You don't understand - we need functioning code ;-)

Although this is a nice feature, I still don't understand why it is so
difficult to use the existing hooks for what you want.

By specifying the following variables you should be able to send mail
with the alias expansion as elm sees fit:

set mailer		path-to-a-script
unset mail-pipe-input

path-to-a-script points to the following script (make sure it is executable):

#! /bin/csh -f

set to = `sed -n -e '/^To:/p' -e '/^To:/q' $1 | sed 's/^To://'`
set subject = `sed -n -e '/^Subject:/p' -e '/^Subject:/q' $1 | sed 's/^Subject://'`
/usr/local/bin/elm -s "$subject" $to < $1 > /dev/null


This works for me (although I'm normally an MH user :-).
And I'm sure you can do the same in a hundred different ways. :-)
The trick is that most mailers need a subject line and the recipient,
which are not given explicitly by nn.

Actually, it would be nice it nn would not only give the message, but also
the recipients and subject when mail-pipe-input is set to false.

Anyways, while looking at the elm manual page, I suppose you could do the
following:

set mail-alias-expander		/usr/local/bin/elm -c

Try it and let people know if it works...

Cheers,

	-Jaap-

jaap@sequent.com (04/23/91)

In <1991Apr19.125422.18608@DSI.COM> syd@DSI.COM (Syd Weinstein) writes:

>Who needs to write C code, just write a shell wrapper around
>the "elm -c" command.
>
>$ elm -c syd
>Expands to: syd@dsi.com (Syd Weinstein)
>
>Then just chop it using expr or sed to remove the stuff you don't
>want, such as the Expands to: and the ( ) comment.

Ah, see, that's what I get when I give suggestions after reading the manual
page but before testing it. Elm is a little too verbose for my taste. :-)

Good old MH does it in one step:

set mail-alias-expander 	<path-to-mh6.7>/ali

for me <path-to-mh6.7> is '/usr/local/bin/mh_6.7'.
For most people it will be '/usr/new/mh'.

	-Jaap-

jaap@sequent.com (04/23/91)

In <1991Apr22.225315.26370@sequent.com> jaap@sequent.com writes:

>set mail-alias-expander 	<path-to-mh6.7>/ali

Obviously this is bogus after Kim explained that you need a program
that rewrites your message, not a program that expands a single alias.

	-Jaap-