pan-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pan-users] Re: Re: How to upload attachments?


From: Duncan
Subject: [Pan-users] Re: Re: How to upload attachments?
Date: Sun, 15 Jan 2006 10:19:24 -0700
User-agent: Pan/0.14.2.91 (As She Crawled Across the Table)

Kevin Brannen posted <address@hidden>, excerpted below,  on
Thu, 12 Jan 2006 21:50:48 -0600:

>>2) Similarly, use the external text editor function.  It should be
>>possible, and I've suggested it before but don't know that anyone has
>>actually done it (if they have, they've not posted it), to script a
>>solution that does the attachment, then saves the combined message and
>>attachment, and set that script as your "external editor" in PAN's
>>preferences dialog, such that when PAN gets control back from the
>>"external editor", the attachment is now part of the message.  I /do/ know
>>someone has used a very similar technique to allow gpg-signing of
>>messages, as that's where I got the idea.  (Unfortunately, I'm not sure
>>that script was ever posted, tho someone commented they had come up with
>>one.)
>>  
> Hmm, interesting idea.  I might have to try to figure that out.

OK, I've been thinking about this a bit, and might see what I can come up
with later this week.

So far I've looked at a few of the command line application options I
could use.  Newspost, and anything else that does its own posting, will
be almost impossible to implement well using the external editor
function, for a number of reasons, including that it would use a
connection, thereby forcing one to use one less connection in PAN, and
that since the PAN external editor function ONLY passes the post BODY, not
the headers, it would be extremely difficult to pass info such as the
newsgroup to post to, the subject, etc.

The alternative that can actually work, therefore, is using something like
uuenview (uudeview) to do the actual file encoding, but having PAN handle
the posting, since only it has the necessary header information.  This of
course means that the glue-code script will be SERIOUSLY more complicated,
since it will have to take the actual encoded file and insert it into the 
message correctly, adding appropriate attachment begin and end flags as
appropriate.

I'm going to try to keep this first implementation non-interactive and as
simple as possible, with a main goal of actually getting a solution out
there, even if it's very crude. Picking the file to attach therefore
becomes an issue, as well as telling the "editor" which encoding type to
use.  yEnc must be an option here or it's not worth my trouble, yet due to
the fact that many clients don't support it yet, uuencoding and/or
MIME/base64 should be optiions as well.

I /said/ it was crude, but here's a method that should work -- make the
glue-script recognize a couple key variables -- and their escapes.  So,
something like "$$attach=/path/to/the/file/to/attach.jpg$$"
(without the quotes) delimited by the $$ signs, all alone on its own line,
will be detected by the script, with it deleted and the file it points to
attached to the end of the message. Likewise, "$$encoding=yenc$$" on its
own line will be detected, honored, and removed.  That may do it, since
few of the other options would make much sense in that environment. 

The problem of course is having to specify the path and file in long form
without tab completion or a file selection dialog.  However, it'll be
something we don't have now, and improvements from that can be done later,
if desired.  I (or someone else) can then either change the script to use
xdialog or the like for interactivity, or rewrite it in python, using its
more advanced scripting and library techniques to handle the GUI part.

License will be identical to PAN's (GPL).

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman in
http://www.linuxdevcenter.com/pub/a/linux/2004/12/22/rms_interview.html






reply via email to

[Prev in Thread] Current Thread [Next in Thread]