🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
5 messages
5 total messages Started by Robert Nicholson Tue, 15 Mar 1994 16:04
Using Elm within trn (solution)
#8068
Author: Robert Nicholson
Date: Tue, 15 Mar 1994 16:04
69 lines
2554 bytes
Well I have a solution that is to my liking.  Except I always have to
press return to get the Copies to: prompt in elm after Subject:

Anyway, the objective was to be able to use elm for all news
contributions.  reply/followup.  This way I can then store my postings
and replies in =sent or filter based on Subject: and store them in a
separate folder.

So here's what I did.

Any improvements are welcome.

For Replies I added the following to .zshenv

export MAILPOSTER="elm -i %h -s \"Re: %S\" %t" (Thanks to the FAQ)

This invokes elm for replies within trn.

That's the easy bit because elm always wants an address to mail to.

For Followups it's a bit more involved.

Now I didn't like the idea of relying on mail2news gateways in order to
post news.  So I chose to set up an alias to handle postings.

export NEWSPOSTER="elm -i %h -s \"Usenet News Post\n\n\" usenetnews"

The postings go to the usenetnews (as opposed to usenet) alias.

This gets processed in procmail thus.

:0b
* ^TOusenetnews
| sed -n '/Newsgroups/,$p' | /usr/local/news/inews -h

---

If anybody knows how I can strip the second set of elm headers so that
the sed can be removed, then let me know.

A message _body_ usually looks like this.


To: usenetnews
Date: Tue, 15 Mar 1994 15:43:34 +0000 (GMT)
cc: robert
X-Mailer: ELM [version 2.4 PL23]
Content-Type: text
Content-Length: 171       

Newsgroups: alt.test
Subject: testing
Summary: 
Expires: 
Sender: 
Followup-To: 
Distribution: world
Organization: me organised, that's a joke.
Keywords: 
Cc: 

Testing.

-- 
   "You know what's wrong with you?"              (Audrey Hepburn, Cary Grant)
       "No, what?"
   "Nothing"                                      (Charade, 1963)
                (ASCII for text only messages)
Re: Using Elm within trn (solution) (A problem)
#8071
Author: Robert Nicholson
Date: Tue, 15 Mar 1994 17:04
56 lines
2504 bytes
robert@steffi.demon.co.uk (Robert Nicholson) wrote in comp.mail.elm,news.software.readers
>export NEWSPOSTER="elm -i %h -s \"Usenet News Post\n\n\" usenetnews"


For those folks following this thread.  I have one problem with this
now.

When using trn and posting an article you are immediately asked for
Subject: and Distribution:  I want the contents of the Subject: so
that I can pass them to elm's -s flag in NEWSPOSTER (with lazy
evaluation).  Otherwise all stored postings will have the same subject. 
You see %S normally only represents the subject for the _current_ 
article. So when composing a new article %S doesn't exist.

In fact the only place that Subject and Distribution is stored is in
~/.rnhead

This is a significant limitation.

---

Well I thought about it for a while and came up with the following
attempt.

NEWSPOSTER=\`/usr/local/bin/post %h %S\`

The post script looked something like this.

# $1 = %h
# $2 = %S

sleep 2 # wait for contents of ~/.rnhead to be written

if [ $# -eq 1 ] ; then
	s=`grep Subject: ~/.rnhead | sed 's/Subject: \(.*\)/\1/'`
	elm -i $1 -s "$s" usenetnews
else
	elm -i $1 -s "$2" usenetnews
fi

----

All signs were that this would work. but for some reason it just hung
attempting to bring up elm. (PL23)

I really really don't want to have to do this like this.

Is there any reason why the Subject: from the prompt in a new post
cannot be stuffed into %S?

-- 
   "You know what's wrong with you?"              (Audrey Hepburn, Cary Grant)
       "No, what?"
   "Nothing"                                      (Charade, 1963)
                (ASCII for text only messages)
Re: Using Elm within trn (solution) (A problem)
#8104
Author: Wayne Davison
Date: Wed, 16 Mar 1994 20:03
70 lines
3155 bytes
According to Robert Nicholson <robert@steffi.demon.co.uk>:
> I want the contents of the Subject: so that I can pass them to elm's -s
> flag in NEWSPOSTER (with lazy evaluation).

What I'd like to know is why elm needs the -s flag when you call it with
a header (-i) that includes a subject line?  This is a bug in elm.

As for your trn predicament, try the following.  First you need a way to
get trn to stop prompting for the subject.  This prompting occurs in the
NEWSHEADER definition, which I've expanded from common.h's definition
into .trninit-file syntax (the stuff between the ----'s):

-------------------------------------------------------------------------
-ENEWSHEADER="%(%[followup-to]=^$?:X-ORIGINAL-NEWSGROUPS: %n
)Newsgroups: %(%F=^$?%C:%F)
Subject: %(%S=^$?%\"

Subject: \":Re: %S)
Summary: 
Expires: 
%(%R=^$?:References: %R
)Sender: 
Followup-To: 
%(%{REPLYTO}=^$?:Reply-To: %{REPLYTO}
)Distribution: %(%i=^$?%\"Distribution: \":%D)
Organization: %o
Keywords: %[keywords]
Cc: %(%F=poster?%t:%(%F!=@?:%F))

"
-------------------------------------------------------------------------

Notice that the Subject: prompt happens using the %" interp to generate a
value to put into the header file that it passes to the posting software.
You want to move this prompt to your NEWSPOSTER definition to generate a
value for elm's -s flag.  Here's both definitions ready for your .trninit:

-------------------------------------------------------------------------
-ENEWSPOSTER="elm -i %h -s '%(%S=^$?%\"

Subject: \":Re: %'S)' usenetnews"
-ENEWSHEADER="%(%[followup-to]=^$?:X-ORIGINAL-NEWSGROUPS: %n
)Newsgroups: %(%F=^$?%C:%F)
Subject: %S
Summary: 
Expires: 
%(%R=^$?:References: %R
)Sender: 
Followup-To: 
%(%{REPLYTO}=^$?:Reply-To: %{REPLYTO}
)Distribution: %(%i=^$?%\"Distribution: \":%D)
Organization: %o
Keywords: %[keywords]
Cc: %(%F=poster?%t:%(%F!=@?:%F))

"
-------------------------------------------------------------------------

It's not pretty, but it's doable.  Too bad elm doesn't do the right thing
with -i or none of this would be necessary.  I use mush for sending mail
and it only needs "mush -h %h" to do the right thing.  Maybe someone could
fix elm to handle this correctly?

One final note, you need trn 3.4.1 to use the tick-modifier (e.g. %'S -- it
quotes the apostrophes in the argument).  If you have an older trn, leave
off the "'".
-- 
Wayne Davison
davison@borland.com
Re: Using Elm within trn (solution) (A problem)
#8106
Author: Robert Nicholson
Date: Wed, 16 Mar 1994 21:39
29 lines
1947 bytes
davison@borland.com (Wayne Davison) wrote in comp.mail.elm,news.software.readers
>According to Robert Nicholson <robert@steffi.demon.co.uk>:
>> I want the contents of the Subject: so that I can pass them to elm's -s
>> flag in NEWSPOSTER (with lazy evaluation).
>
>What I'd like to know is why elm needs the -s flag when you call it with
>a header (-i) that includes a subject line?  This is a bug in elm.

Is this true or did I over look something?  I'd really like this
qualified. The header from -i isn't a "mail" header though is it? ie.
From.....

Here's what I did in the end. after Chip's recommendation.

export MAILRECORD=~/Mail/sent
export AUTHORCOPY=~/Mail/postings

I changed the cc handling in Pnews to "elmalias" the mail address so
that I can use elm aliasing on the CC: header.

Works very nicely now and achieves everything I set out to achieve but
doesn't use elm.

-- 
   "You know what's wrong with you?"              (Audrey Hepburn, Cary Grant)
       "No, what?"
   "Nothing"                                      (Charade, 1963)
                (ASCII for text only messages)
Re: Using Elm within trn (solution) (A problem)
#8107
Author: Syd Weinstein
Date: Wed, 16 Mar 1994 21:44
21 lines
1751 bytes
davison@borland.com (Wayne Davison) writes:

>According to Robert Nicholson <robert@steffi.demon.co.uk>:
>What I'd like to know is why elm needs the -s flag when you call it with
>a header (-i) that includes a subject line?  This is a bug in elm.

Actually, no, its not a bug, as it works as intended (and I consider
bugs things that don't work as intended.)

Anyway, Elm does not support headers in the body of the message.
the -i flag means init the body with the contents of this file.

Put the two together, and it works as intended.  Now, you may not
like the limitation, and thats an engineering request for a change
during the rewrite.  And its been asked for many times.
-- 
========================================================================
Sydney S. Weinstein, CDP, CCP          Elm Coordinator - Current 2.4PL23
Myxa Corporation                       Projected 3.0 Release: ??? ?,1994
syd@Myxa.COM or dsinc!syd      Voice: (215) 947-9900, FAX: (215) 938-0235
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads