Subject: how to feed pine a message body?

From: Ed Arnold <[email-masked]>
Date: Thu, 11 Nov 1999 16:44:01 -0700 (MST)

I have an application in which I use a script to create a form, then
hand the form off to pine as its message body.  The only way I've
found to do this, is to edit .pinerc before invoking pine, setting
signature-file to the name of the file containing the form.  The
disadvantage to using signature-file, is that two null lines are
inserted before the message body.  Anyone know of a better way to do
this?

-- 
-----------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/pine/pine-info/
-----------------------------------------------------------------

---

From: Mike Miller <[email-masked]>
Date: Thu, 11 Nov 1999 18:23:39 -0600 (CST)

> inserted before the message body.  Anyone know of a better way to do

You can use pine in a script like this:

cat filename | fmt -w 75 | pine

This will launch pine with the stdin in the message body.  I do this many
times each day.  It works great.  It doesn't matter if another copy of
pine is running (no effect at all).

One thing I don't like, and I've said it before but was ignored:  Older
versions of pine would not prompt about continuing a postponed message
when pine was used at the end of a pipe.  That seems appropriate to me.  
Now pine does prompt.  If you say 'Y' by mistake, it kills what you were
trying to do.  I wish they'd fix that one.  I don't think it could be hard
to fix.

Regards,

Mike

-- 
Michael B. Miller
University of Missouri--Columbia
http://taxa.psyc.missouri.edu/~mbmiller/

---

From: [email-masked]
Date: Thu, 11 Nov 1999 16:49:12 -0800 (PST)

>pine is running (no effect at all).

Yikes, I just tried this.

It ends up going into pine 'live'..

(I catted some junk into a temp file, then
cat asdf | pine [email-masked] )

is there some way I can do this so that it DOESN'T throw me into pine,
but 
1) Mails the message and
2) puts it in my sent mail folder?

Especially if the message then looks like it's from me.  I've rarely done it
but once in a while I try to forward a Usenet post by just
| mail [email-masked]

and the message then looks like it came from the Usenet poster, not me.
(Someone a few weeks ago thought one I sent was spam!)  Of course going into
my sent mail folder is good too.

Heck, this may even be usable if I can set up Lynx to use pine as a mailto:
mailer for the rare times I send letters from mailto: links.  

(RAMBLE/RANT begins: This is one of the very few complaints I have about UNIX
programs compared to some GUI programs -- while UNIX programs obviously use
other programs to do part of their work, it seems harder/not possible to link
_high level user kinds of programs_ together..  No, I know I can use an
external editor and I do that now already [I probably wouldn't use pine if I
couldn't use vim as my editor]..  But I guess I mean higher level interaction
other than using an editor.)

---

From: Ed Arnold <[email-masked]>
Date: Thu, 11 Nov 1999 19:38:50 -0700 (MST)

Revisiting my previous query about getting a message body into pine,

Mike Miller pointed out that you can cat a file into it, which gives
one a live session.  Unfortunately, in my case, I am using a
"-url mailto:...?Subject=..." argument to pine at the same time.
Thus, I can't cat a file into it (the result of trying to do that is
a pine abort and core dump).  The only way I've found to accomplish
what I need, is the trick with signature-file in .pinerc or -signature-file
on the command line.

I suspect that pine is the wrong tool for non-interactive mailing.

---

From: Satya <[email-masked]>
Date: Fri, 12 Nov 1999 09:26:39 +0530 (IST)

> hand the form off to pine as its message body.  The only way I've

What kind of script? You should hand the message off to sendmail, not
pine.

> mailer for the rare times I send letters from mailto: links.  

Nope, lynx is smart and hands the emssage to sendmail. directly.

> other than using an editor.)

You miss the point. In Unix, a program is expected to do one job and do it
well. "high level user kinds of programs" are implemented with plumbing.
You're trying to get pine to do mail delivery, which is not it's job. That
is sendmail's job. Pine's job is to be a mail user agent. In Ed's case,
the UA is the script. In your case, it's Lynx.

> I suspect that pine is the wrong tool for non-interactive mailing.

Yes.

-- 
Satya.
http://satyaonline.cjb.net/

---

From: Mike Miller <[email-masked]>
Date: Thu, 11 Nov 1999 22:46:49 -0600 (CST)

> I suspect that pine is the wrong tool for non-interactive mailing.

If you don't need to 'interact' at all, and the message is ready to send
without further editing, you can (and should) use something else.  For
example:

process file | mailx -s "This is the Subject" [email-masked]

That line starts with some process operating on a file to produce some
output.  That is piped through mailx.  I'm using Solaris operating system
and I find that mailx does the job for me.  (man mailx).

You can also take a file and mail it (don't need to use 'cat') as follows:

mailx -s "This is the Subject" [email-masked] < filename

That will mail the file named "filename" to [email-masked]' with the
Subject "This is the Subject".

Regards,

Mike

---

From: Bobby Ezell <[email-masked]>
Date: Fri, 12 Nov 1999 10:01:44 -0800 (PST)

I actually have a similar need. While this is getting away from pine in
many respects, I want to do a script line similar to what you have below
with two files:
	The first file needs to be included as an attachment
	The second file (all text) needs to be dropped in as the message
	 body.

I have tried the below approach but it seems to not work or attachmnt:
does not go correctly, and then cat'ing the text file in to the body seems
to not be consistent. I too have tried to automate this with pine also,
but not much success. Any suggestions out there?

Bobby Ezell
RSI

> Subject "This is the Subject".

-------------------------------------------------------------------
Bobby Ezell                           E-Mail:  [email-masked]      
Technical Sales Support               V-Mail:  503-624-0360 (voice)       
Rasmussen Software, Inc.              F-Mail:  503-624-0760 (fax)       
10240 SW Nimbus Ave., Ste L9          http://www.anzio.com 
Portland, OR 97223                    http://www.anzio.com/~bezell   
-------------------------------------------------------------------
        AnzioLite and AnzioWin for all your telnet needs
       Send sales & support questions to:  [email-masked]
-------------------------------------------------------------------
The information contained in this mail is confidential and intended
for the end-users use only.
===================================================================

---

From: Ed Arnold <[email-masked]>
Date: Fri, 12 Nov 1999 11:40:46 -0700 (MST)

I found that the problem I was having could be solved by dropping the
"-url" argument and using a "-customized-hdrs" argument instead, like:

 cat $TmpMsgFile | \
 pine -customized-hdrs="Subject: $MsgTitle,Reply-To: [email-masked]" \
 $DestEmailAddrs

Pine's "customized-hdrs" variable will accept header names and values,
whereas "default-composer-hdrs" accepts only header names.

I tried this with -attach.  So long as "-attach" comes before the
other args, it seems to work.  I.e. this should do what you want:

cat $bodyfile | \
pine -attach $attachfile -customized-hdrs="Subject: clowns" [email-masked]

---

From: [email-masked]
Date: Fri, 12 Nov 1999 11:43:13 -0800 (PST)

>process file | mailx -s "This is the Subject" [email-masked]

How can I get such a letter like this put in my sent-mail folder on my IMAP
account?

I know I'm not the originator of this discussion, but I really wish I had
one place, my sent-mail folder, to go to look for ALL mail I send from this
account.

---

From: Nancy this-address-is-valid McGough <[email-masked]>
Date: Sat, 13 Nov 1999 12:59:24 -0500 (EST)

On 99-11-12 Satya <[email-masked]> wrote:
> > I have an application in which I use a script to create a
> > form, then hand the form off to pine as its message body.
> 
> What kind of script? You should hand the message off to
> sendmail, not pine.

But if you want to use your pine configuration, e.g., custom
headers, roles, Fcc, address book nicknames, etc., being able to
use pine in a script would be great.

Nancy
add my name to the growing list of people who want to use pine
non-interactively

PS - Some people have posted that they use expect so you might
want to check that out.

-- 
For Pine links, see http://www.ii.com/internet/messaging/pine/
 
©Nancy McGough         http://www.ii.com/         Infinite Ink
--= Sent via PINE 4.20: Internet News & Email for Win/Unix =--