[REBOL] %detach.r Re:(2)

2000-06-12 Thread sterling


Ah.  now I see what's happening.  The attachments are embedded in
another attachment tag.  My detach sctip doesn't handle that just yet
and no time to fix it right now.

I'm going to mail you a different one off the list that should work.

Sterling

> OK, making the change and running the script produced the following 
> result:
> 
> >> detach msg2
> starting decoding process...
> Boundary string: _--_BeOS.rmp.960760
> Found message attachment; remaining length: 10312
> Found message attachment; remaining length: 15
> breaking... attachents finished
> == [none {Content-Type: multipart/x-bfile;
> ^-boundary="++BFile111399423249++"
> }]   
> 
> 
> The script broke without decoding attachments. Following is msg2/
> content...
> 




[REBOL] %detach.r Re:(2)

2000-06-11 Thread allenk


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 12, 2000 3:44 AM
Subject: [REBOL] Re: %detach.r



I would suggest you learn about MIME, it will give a better understanding.
(It will help you recognise and fix poorly constructed mime messages too,
like the one you presented)

MIME (Multipurpose Internet Mail Extensions) Part One:
Mechanisms for Specifying and Describing
the Format of Internet Message Bodies
http://www.cis.ohio-state.edu/htbin/rfc/rfc1521.html


And this one is good reading for learning about other email headers.
STANDARD FOR THE FORMAT OF
 ARPA INTERNET TEXT MESSAGES

http://www.cis.ohio-state.edu/htbin/rfc/rfc822.html


Cheers,

Allen K





[REBOL] detach.r Re:(2)

2000-06-09 Thread RChristiansen

Doing as you said overcame the problem of the function looking for a string! 
instead of an object!

But...

>> detach msg
starting decoding process...
== none

Then I had to change

   if boundary: find/tail boundary {boundary="}

to 

   if boundary: find/tail boundary {boundary=}

Then...

>> do %detach.r
Script: "Save email attachments to disk" (9-Jun-1999)
>> detach msg
starting decoding process...
Boundary string: Message-Boundary-1182
Found message attachment; remaining length: 6451
Found message attachment; remaining length: 6309
Found message attachment; remaining length: 5687
Found message attachment; remaining length: 5
** Script Error: copy expected range argument of type: number series
 port.
** Where: file: copy/part headers/content find body:
>>

Again, is the {boundary=} statement sent by Pegasus causing problems?

> 
> Take another look at the detach function.  It expects the wohle email
> message as text, including all the headers and everything.  If you already
> have the imported email object, you should be able to change the top of
> the detach func to look like this:
> 
> detach: func [
> {Takes in the whole email text and returns a block of filenames
> and decoded base64 attachments present in the email}
> mail [object!]
> ][
> headers: mail
> print "Starting decoding process..."
> boundary: headers/content-type
> 
> .. rest of script...
> 
> and then call 'detach msg'
> 
> Sterling
> 
> > I am trying to detach an attachment (.jpg image) from an e-mail using
> > the script detach.r from the REBOL script library. Unfortunately, I am
> > getting an error, as follows...
> > 
> > >> detach msg/content
> > starting decoding process...
> > ** Script Error: find expected series argument of type
> > : series port bitset.
> > ** Where: if boundary: find/tail boundary {boundary="}
> > 
> > In the 'msg/content, there is no {boundary="} statement. Instead, there
> > is a {-- Message-Boundary-11825} statement.
> > 
> > My question is: Is my Pegasus e-mail client sending some non-standard
> > "boundary" indicator? Is there any way to set this up so that the script
> > will work with most e-mail clients?
> > 
> > I can't find any other information in the REBOL docs or examples about
> > detaching e-mail attachments.
> > 
> > Thanks. Detailed msg/content and detach.r script information follows...
> > 
> > The msg/content looks as follows...
> > 
> 
> 
>