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

World: r3wp

[Core] Discuss core issues

Graham
9-Mar-2005
[631]
So, there is no nslookup utility for rebol ?
Tomc
9-Mar-2005
[632]
must be http://www.compkarori.com/soap/index.shtml
Graham
9-Mar-2005
[633]
you lost me ...
BrianW
9-Mar-2005
[634x2]
print read dns://www.coolnamehere.com/

or is that not what you were thinking of?
hmm.
Tomc
9-Mar-2005
[636]
that is what I was looking for
Graham
9-Mar-2005
[637x2]
I want to find the mail server for a given email address...
so I can implement outgoing smtp mail ...
BrianW
9-Mar-2005
[639]
finger? whois?

I'm behind a firewall, so I don't know which (if either)
Tomc
9-Mar-2005
[640]
read join dns:// mailhost
Graham
9-Mar-2005
[641]
but how do you know the mailhost ?
Tomc
9-Mar-2005
[642x2]
from the part agrer the @ in the email address I wouls think
after
Graham
9-Mar-2005
[644x2]
nope ..
I have an email ... [gchiu-:-compkarori-:-com] .. 
How would you get the MX record for that?
BrianW
9-Mar-2005
[646]
... trying to find something useful right now :-)
Graham
9-Mar-2005
[647x3]
this is the answer : 203.79.110.37
because I know it :)
leave me a message here if you find anything :)
BrianW
9-Mar-2005
[650x2]
Will do :-)
http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=dig.r
maybe?
Ammon
9-Mar-2005
[652]
Dig.r does appear to support MX...
Graham
9-Mar-2005
[653x3]
ahh... I looked for digger but not dig
>> res: read dig://203.96.152.4/MX/www.compkarori.com
connecting to: 203.96.152.4
>> print res/to-str
;; REQUEST: MX(15) for www.compkarori.com

;; id: 52715 AA: 0.0 RD: 1.0 RA: 1.0 ANSWER(s): 0 AUTHORITY(s): 1 
ADDITIONAL(s): 0

;; ANSWER(s):

;; AUTHORITY(s)

compkarori.com. 531 SOA ns1.webxess.net.  postmaster.webxess.net. 
 2005030501  10800  3600  1209600  600

;; ADDITIONAL(s)
Doesn't give me the correct answer :(
BrianW
9-Mar-2005
[656x2]
what about
	read dig://www.comparori.com/MX
.oO(firewalls are annoying at moments like this)
Graham
9-Mar-2005
[658]
hey, that works :)
BrianW
9-Mar-2005
[659]
good, had to guess my way through in my head :-D
Graham
9-Mar-2005
[660x2]
Now I can start coding my smtp server for outgoing mail.
actually, this is the form I used 

>> res: read dig://203.96.152.4/MX/compkarori.com
connecting to: 203.96.152.4
>> probe res/to-str
{;; REQUEST: MX(15) for compkarori.com

;; id: 53188 AA: 0.0 RD: 1.0 RA: 1.0 ANSWER(s): 2 AUTHORITY(s): 3 
ADDITIONAL(s): 3

;; ANSWER(s):
compkarori.com.^-247^-MX^-0   pop.compkarori.com.
compkarori.com.^-247^-MX^-10   pop.compkarori.com.

;; AUTHORITY(s)
compkarori.com.^-596^-NS^-ns3.webxess.net.
compkarori.com.^-596^-NS^-ns1.webxess.net.
compkarori.com.^-596^-NS^-ns2.webxess.net.

;; ADDITIONAL(s)
pop.compkarori.com.^-596^-A^-203.79.110.37
ns1.webxess.net.^-69731^-A^-216.166.83.11
ns2.webxess.net.^-69731^-A^-216.166.83.12
}
BrianW
9-Mar-2005
[662]
oh, the www was confusing it?
Graham
9-Mar-2005
[663x2]
yeah ..
>> res: read dig://203.96.152.4/MX/compkarori.com
connecting to: 203.96.152.4
>> probe res/additionals/1/Rdata/ip
203.79.110.37
== 203.79.110.37
JaimeVargas
10-Mar-2005
[665]
Graham depends on the tool. With dig. You do
dig MX domain.dom
Graham
12-Mar-2005
[666x4]
what does this mean?


   * Generate 64 bits of randomness from a good, well-seeded random 
   number generator;

ie. how large a seed do I need to get 64 bits ?
http://www.jwz.org/doc/mid.html
	

 In summary, one possible approach to generating a Message-ID would 
 be:

    * Append "<".


    * Get the current (wall-clock) time in the highest resolution to 
    which you have access 

    (most systems can give it to you in milliseconds, but seconds will 
    do);


    * Generate 64 bits of randomness from a good, well-seeded random 
    number generator;


    * Convert these two numbers to base 36 (0-9 and A-Z) and append the 
    first number, 

    a ".", the second number, and an "@". This makes the left hand side 
    of the message ID be only about 21 characters long.


    * Append the FQDN of the local host, or the host name in the user's 
    return address.

    * Append ">".
enbase doesn't accept a value of 36
I used 1'000'000 here .. don't know if it's enough

    generate-messageid: does [

     rejoin [ "<" enbase form now/time/precise "." enbase form random 
     1000000  "@" server-name ">"]
	]
Gabriele
12-Mar-2005
[670]
basically you need 13 random characters, don't you?
Graham
12-Mar-2005
[671x2]
I"m not sure ...
where does the 13 come from?
Gabriele
12-Mar-2005
[673x2]
a 64 bit number has 64 digits in base 2, and 12-13 digits in base 
36
anyway, since you just need some randomness, a random 12 character 
string will do
Graham
12-Mar-2005
[675]
so use base 32 ?
Gabriele
12-Mar-2005
[676x2]
>> s
== "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"
>> pool: "" insert/dup pool s 12
== ""
>> random/seed now
>> copy/part random/secure pool 12
== "GQOTTWDZZXNL"
>> copy/part random/secure pool 12
== "JOFF6QY4T2H8"
>> copy/part random/secure pool 12
== "8RJ2MFTQ0IJQ"
>> copy/part random/secure pool 12
== "ZKCS1DX7UTHL"
>> copy/part random/secure pool 12
== "DY3VJH4UTNFF"
>> copy/part random/secure pool 12
== "KWPNQRIJ40KN"
note that "well seeded" usually means you're seeding from some truly 
random value, rather than the current time
Graham
12-Mar-2005
[678]
I guess since I'm not processing that many email, it doesn't have 
to be truly random.
Gabriele
12-Mar-2005
[679x2]
i think that for your purposes, enbase/base 64 would be just fine
so you could use something like: