r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

MichaelAppelmans
11-Jun-2005
[1215]
this is from a simple example in the script library with the only 
modification being an open block instead of a single line open. Thanks 
for any insight.
Graham
11-Jun-2005
[1216x2]
that would happen if mailbox = none
try 

print type? mailbox before you use the foreach
MichaelAppelmans
11-Jun-2005
[1218]
thanks Graham, I get " type has no value" does this mean that rebol 
is unable to open this pop account? I know my domain, user and pwd 
are correct
Graham
11-Jun-2005
[1219x2]
don't you need to specify the port id/
try setting 

trace/net on

before you open the port and see what happens
BrianH
11-Jun-2005
[1221]
No, it means that you used type instead of type? (with the question 
mark)
MichaelAppelmans
11-Jun-2005
[1222]
right  you are Brian, I had type ? not type? which returns port. 
so it is opening the mailbox but isn't mailbox a series?
Graham
11-Jun-2005
[1223]
I think some of the documentation on pop is incorrect as you have 
found.
MichaelAppelmans
11-Jun-2005
[1224]
aha. I think my understanding of using pop is flawed. i need some 
zzzzz's for now will play with this on the morrow. thanks for the 
help. gnight
Graham
11-Jun-2005
[1225]
user:[pass-:-mail-:-example-:-com]
remove at mailbox 22
close mailbox

this example I'm pretty sure doesn't work
MichaelAppelmans
11-Jun-2005
[1226]
complication is i have a password with special chars % and $ so i 
have to use the block form of the url
Graham
11-Jun-2005
[1227]
that's not the problem
MichaelAppelmans
11-Jun-2005
[1228x2]
i think i figured out what the problem was, I had a pop block, with 
open mailbox: open [scheme: 'pop ...etc
i tried mailbox: read [scheme: 'pop and it's running but I expect 
to run out of heap space as I have 800 emails  ;)
Graham
11-Jun-2005
[1230x2]
; open mailbox

len: length? mailbox
bounces: copy []

for i 1 len 1 [
	email: import-email raw: pick mailbox i
	if email/reply-to = "<>" [
		append bounces i
		print [ "Bounce at" i ]
	]
]

; remove bounces

reverse bounces
foreach num bounces [
	mailbox: head mailbox
	mailbox: skip mailbox ( num - 1 )
	remove mailbox
]

close mailbox
untested ... :)
MichaelAppelmans
11-Jun-2005
[1232]
wow, I'm impressed, I might have to stay awake for this ;)!!
Gregg
11-Jun-2005
[1233]
Graham is the mail master, along with Phil. :-)
Graham
11-Jun-2005
[1234]
Hey, it's untested .... !!
MichaelAppelmans
11-Jun-2005
[1235x2]
this is a great example. at this time I'm going to be moving bounces 
into another mailbox instead of deleting them as I need them for 
forensic evidence. We have just received word that the ISP is forcing 
the subscriber offline as the spam constitues a breach of contract
thanks I'll  kick this around a bit but it's a great start for someone 
who's having trouble wrapping his head around the rebol paradigm, 
too many decades of procedural programming, I'm afraid.
Graham
11-Jun-2005
[1237]
this is rather brute force as each email is downloaded ...
better to use one of the top hacks to just get the headers
MichaelAppelmans
11-Jun-2005
[1238]
good idea, some of the emails are huge'
Graham
11-Jun-2005
[1239]
I reversed the series so that you remove them from the end backwards

as otherwise I guess the numbering changes if you remove from the 
head instead
MichaelAppelmans
11-Jun-2005
[1240]
any idea if there is a way to read emails and forward them to another 
inbox without altering the header? it would be nice if I could move 
them from one account to another without affecting the to/from.
Graham
11-Jun-2005
[1241]
why not just write them to a text file?
MichaelAppelmans
11-Jun-2005
[1242]
well, i'll do that to, but if I have to forward one to someone its 
easier if its in an inbox. at this point i've been up too many hours 
in a row to think straight, so I'm just trying to preserve everything 
in statis in case we have to revisit the "evidence".
Graham
11-Jun-2005
[1243]
that should be 

 email/return-path = "<>"
MichaelAppelmans
11-Jun-2005
[1244x2]
got it
thanks
Graham
11-Jun-2005
[1246]
I guess you could save them individually, and then send to the other 
mailbox as an attachment
MichaelAppelmans
11-Jun-2005
[1247]
were talking thousands. I just have 800 in one account.. i would 
just as soon tie up some of my 1GB on the providers mail server ;)
Graham
11-Jun-2005
[1248]
I know your pain.  I was the victim of such an identity theft, and 
I was getting 10,000 bounces a day.
Guest
11-Jun-2005
[1249]
Hello.  I was wondering how to replace a quotation mark in a string.. 
like this.
x: 'this " one'
replace x '"' ""

??
ChristianE
11-Jun-2005
[1250]
replace/all {A"B"C} {"} "'"
Guest
11-Jun-2005
[1251]
Ok, thanks.
Tomc
11-Jun-2005
[1252x3]
the carret is rebol's escape chat so
>> s: "^""
== {"}
is another way
Graham
13-Jun-2005
[1255x2]
Just reading the rbbs.r script, and there are a number of comments 
about Rebol/View embedded in it .. which is a little odd as R/View 
is not recommended to be used to run cgi scripts.
Ahhh, they were added by Dirk Weyland to make it compatible with 
his serve-it web server.
Henrik
13-Jun-2005
[1257x3]
did the latest version of OSX Rebol/Core come with the new FTP stuff? 
I have lots of trouble with a flakey FTP server here both with old 
and new versions of Rebol/Core for OSX...
User Error: Server error: tcp 500 RT not understood
 seems a bit broken to me
this is very strange... I get a whole range of different random errors: 
time outs, connection refused, commands not understood
Graham
13-Jun-2005
[1260x3]
For those that have smtp problems, I have posted a way to the mailing 
list on how to make rebol smtp send directly to the recipient's mail 
server by passing those messages about no mail forwarding allowed. 
 I would be interested to hear if anyone tries it out, and how well 
it works.
This means that a cgi script should be able to send out email even 
though the host does not provide a mail server for this purpose.
Of course, anyone using this method to spam will be $#@#!^@
Henrik
16-Jun-2005
[1263]
Working with INDEX? often, it annoys me that it can't handle none! 
values. If I for example want the index for a value and in some cases 
the value can't be found:

index? find [a b c] 'd


FIND returns none!, which INDEX? can't handle. I would have liked 
to see INDEX? also return none! or false! (like FOUND?) rather than 
an error. It gives a better flow and the same opportunity for checking 
on your FIND result, but you don't need to handle the error.


The reason I'm pointing this out is that some functions tend to go 
hand in hand, such as INDEX? FIND, and I think it would be nice that 
no errors ever occurred here in all naturally occuring states.


LENGTH? can sometimes be a bit of a pain with that too. What do you 
think?
Ashley
16-Jun-2005
[1264]
I have that problem all the time with having to write

	first find series val

as:

	if f: find series val [f: first f]