SMTP authentication - the answer - but another question
[1/8] from: kitson:maxis:my at: 19-Apr-2001 10:49
Hi Scott and Brett,
Thanks for your suggestions - I took it to 'feedback' and got -
> "REBOL does not currently support SMTP authorization though your request
has been added to our protocol enhancement list.
> If you can't possibly wait, the SMTP protocol in REBOL is writtin in REBOL
and can therefore be modified by you or anybody else to support
authorization."
So, being a dog with a bone, I've pasted the results of probing the smtp
scheme below in the hope that somebody better able than I could add the
doubtless 2 or 3 lines of code to make it work. If somebody does take on
the challenge and doesn't have a SMTP server account that requires
authentication, please email me ([kitson--maxis--net--my]) and I can provide
details of a temporary account for testing purposes.
Thanks Rebols!
Nick
>> probe get in system/schemes 'smtp
make object! [
scheme: 'SMTP
host: none
port-id: 25
user: none
pass: none
target: none
path: none
proxy:
make object! [
host: none
port-id: none
user: none
pass: none
type: none
bypass: none
]
access: none
allow: none
buffer-size: none
limit: none
handler:
make object! [
port-flags: 524288
open-check: [none "220" ["HELO" system/network/host] "250"]
close-check: ["QUIT" "221"]
write-check: [none "250"]
init: func [
"Parse URL and/or check the port spec object"
port "Unopened port spec"
spec {Argument passed to open or make (a URL or port-spec)}
/local scheme
][
if url? spec [net-utils/url-parser/parse-url port spec]
scheme: port/scheme
port/url: spec
if none? port/host [
net-error reform ["No network server for" scheme "is
specified"]
]
if none? port/port-id [
net-error reform ["No port address for" scheme "is
specified"]
]
]
open: func [
{Open the socket connection and confirm server response.}
port "Initalized port spec"
/locals sub-port data in-bypass find-bypass bp
][
net-utils/net-log ["Opening tcp for" port/scheme]
if not system/options/quiet [print ["connecting to:" port/host]]
find-bypass: func [host bypass /local x] [
if found? host [
foreach item bypass [
if all [x: find/match/any host item tail? x] [return
true]
]
]
false
]
in-bypass: func [host bypass /local item x] [
if any [none? bypass empty? bypass] [return false]
if not tuple? load host [host: form system/words/read join
dns:// host]
either find-bypass host bypass [
true
] [
host: system/words/read join dns:// host
find-bypass host bypass
]
]
either all [port/proxy/host bp: not in-bypass port/host
port/proxy/bypass find [s
ocks4 socks5 socks] port/proxy/type] [
port/sub-port: net-utils/connect-proxy port 'connect
] [
sub-port: system/words/open/lines [
scheme: 'tcp
host: either all [port/proxy/type = 'generic bp]
[port/proxy/host] [port/
proxy/host: none port/host]
user: port/user
pass: port/pass
port-id: either all [port/proxy/type = 'generic bp]
[port/proxy/port-id]
[port/port-id]
]
port/sub-port: sub-port
]
port/sub-port/timeout: port/timeout
port/sub-port/user: port/user
port/sub-port/pass: port/pass
port/sub-port/path: port/path
port/sub-port/target: port/target
net-utils/confirm/multiline port/sub-port open-check
port/state/flags: port/state/flags or port-flags
]
open-proto: func [
{Open the socket connection and confirm server response.}
port "Initalized port spec"
/locals sub-port data in-bypass find-bypass bp
][
net-utils/net-log ["Opening tcp for" port/scheme]
if not system/options/quiet [print ["connecting to:" port/host]]
find-bypass: func [host bypass /local x] [
if found? host [
foreach item bypass [
if all [x: find/match/any host item tail? x] [return
true]
]
]
false
]
in-bypass: func [host bypass /local item x] [
if any [none? bypass empty? bypass] [return false]
if not tuple? load host [host: form system/words/read join
dns:// host]
either find-bypass host bypass [
true
] [
host: system/words/read join dns:// host
find-bypass host bypass
]
]
either all [port/proxy/host bp: not in-bypass port/host
port/proxy/bypass find [s
ocks4 socks5 socks] port/proxy/type] [
port/sub-port: net-utils/connect-proxy port 'connect
] [
sub-port: system/words/open/lines [
scheme: 'tcp
host: either all [port/proxy/type = 'generic bp]
[port/proxy/host] [port/
proxy/host: none port/host]
user: port/user
pass: port/pass
port-id: either all [port/proxy/type = 'generic bp]
[port/proxy/port-id]
[port/port-id]
]
port/sub-port: sub-port
]
port/sub-port/timeout: port/timeout
port/sub-port/user: port/user
port/sub-port/pass: port/pass
port/sub-port/path: port/path
port/sub-port/target: port/target
net-utils/confirm/multiline port/sub-port open-check
port/state/flags: port/state/flags or port-flags
]
close: func [
{Quit server, confirm and close the socket connection}
port "An open port spec"
][
port: port/sub-port
net-utils/confirm port close-check
system/words/close port
]
write: func [
{Default write operation is a command, so check handshake.}
port "An open port spec"
data "Data to write"
/local here
][
port: port/sub-port
either here: find/match data "DATA" [
net-utils/confirm port data-check
insert port here
insert port "."
] [
net-utils/net-log data
insert port data
]
net-utils/confirm port write-check
]
read: func [
port "An open port spec"
data "A buffer to use for the read"
][
net-utils/net-log ["low level read of " port/state/num "bytes"]
read-io port/sub-port data port/state/num
]
get-sub-port: func [
port "An open port spec"
][
port/sub-port
]
awake: func [
prot "An open port spec"
][
none
]
get-modes: func [
port "An open port spec"
modes "A mode block"
][
system/words/get-modes port/sub-port modes
]
set-modes: func [
port "An open port spec"
modes "A mode block"
][
system/words/set-modes port/sub-port modes
]
data-check: ["DATA" "354"]
]
status: none
size: none
date: none
url: none
sub-port: none
locals: none
state: none
timeout: none
local-ip: none
local-service: none
remote-service: none
last-remote-service: none
direction: none
key: none
strength: none
algorithm: none
block-chaining: none
init-vector: none
padding: none
async-modes: none
remote-ip: none
local-port: none
remote-port: none
backlog: none
device: none
speed: none
data-bits: none
parity: none
stop-bits: none
rts-cts: true
user-data: none
awake: none
passive: none
cache-size: 5
]
[2/8] from: gjones05:mail:orion at: 19-Apr-2001 7:54
From: "Nick Kitson"
> Hi Scott and Brett,
>
> Thanks for your suggestions - I took it to 'feedback' and got -
>
> > "REBOL does not currently support SMTP authorization though your request
> has been added to our protocol enhancement list.
>
> > If you can't possibly wait, the SMTP protocol in REBOL is writtin in
REBOL
> and can therefore be modified by you or anybody else to support
> authorization."
<<quoted lines omitted: 6>>
> Thanks Rebols!
> Nick
<snip to end>
Hi, Nick,
Before APOP was supported, I enjoyed hacking a solution as a way of
understanding REBOL schemes. I was curious about what might be involved in
supplementing the SMTP scheme, but after reading an SMTP Draft (9-Sep-2000)
and RFC 2554 (a proposal on SMTP Authentication), I highly suspect that this
task is beyond my skills. I had assumed that the basic SMTP Authentication
would use clear text, like POP, but apparently nothing is really
standardized. A solution would not likely be generic.
Like you, I'm surprised that more services haven't initiated SMTP
authentication at least to some level.
Best of luck.
--Scott Jones
[3/8] from: mat:eurogamer at: 19-Apr-2001 14:11
Heya GS,
GJ> Like you, I'm surprised that more services haven't initiated SMTP
GJ> authentication at least to some level.
Ahem, no one has yet introduced a proper binary transport system for
E-mail yet other than encoding in base-86 to hack into a 7-bit
character set.
Same is true of Usenet. Some standards are just too ingrained to ever
be improved. I bet it hasn't changed by 2010 ;-/
--
Mat Bettinson - EuroGamer's Gaming Evangelist with a Goatee
http://www.eurogamer.net | http://www.eurogamer-network.com
[4/8] from: kitson:maxis:my at: 19-Apr-2001 23:54
Hi Scott,
I'm now confused again - my Outlook (12/98) & Outlook Express (4/99) have
both implemented SMTP authentication and work successfully with my
authenticating servers. MS are not known to lead the pack in this area so
surely there is standardisation of sorts, (even if it is MS sorts)
Nick.
[5/8] from: holger::rebol::com at: 19-Apr-2001 9:23
On Thu, Apr 19, 2001 at 11:54:42PM +0800, Nick Kitson wrote:
> Hi Scott,
>
> I'm now confused again - my Outlook (12/98) & Outlook Express (4/99) have
> both implemented SMTP authentication and work successfully with my
> authenticating servers. MS are not known to lead the pack in this area so
> surely there is standardisation of sorts, (even if it is MS sorts)
Of sorts, yes. There are five different incompatible formats, not all of
which are documented...
We will probably add support in the next Core release.
--
Holger Kruse
[holger--rebol--com]
[6/8] from: gjones05:mail:orion at: 19-Apr-2001 13:32
From: "Nick Kitson"
> Hi Scott,
>
> I'm now confused again - my Outlook (12/98) & Outlook Express (4/99) have
> both implemented SMTP authentication and work successfully with my
> authenticating servers. MS are not known to lead the pack in this area so
> surely there is standardisation of sorts, (even if it is MS sorts)
>
> Nick.
Good point. Looks like I've been busted again!
Actually, I was not trying to imply that there was some major mystery.
Assuming exactly what you have surmised, out of curiosity, I went looking
for the RFC that covered the arena and was surprised by what I found
(namely, there is no single standard). My guess was that RT didn't really
want to get into an area that hadn't solidified. It was just a guess,
though, and as any frequent reader of this list knows, I'm willing to
publically guess and am sometimes wrong (OK --- it can be frequent some
weeks ;-) .
What I did with APOP was Telnet to the account and watch the prompts that
come up. Then its a matter of matching the prompts with the next steps
needed to do business. Before I made yet another lame offer, I did a little
homework and realized that there probably is a good reason that RT hasn't
already done it. But I don't know.
I'm no expert at REBOL, and in fact I'm not even particularly real good at
it. But I've got moxie, and that seemed to be a good thing in the old
movies. And I'm too dumb to know when to quit, so I usually end up getting
things done. When I looked through the list archives and saw that half a
dozen people had asked the same question you asked, I was puzzled why the
real whizzes didn't just whip something up. But they haven't, and it sounds
like RT is up to their eyeballs just keeping their product rollouts going.
The problem doesn't seem like it should be that hard, just potentially
messy, especially for a nice, well-factored solution. If you've got no
other takers, I'll give it a crack. I just need the temporary account in
order to see how your service does it. No promises, though, on being able
to deliver a solution.
--Scott Jones
[7/8] from: kitson:maxis:my at: 20-Apr-2001 8:34
Scott,
Very many thanks for the offer, however, did you see Holger's response -
#Of sorts, yes. There are five different incompatible formats, not
# all of which are documented...
# We will probably add support in the next Core release.
I guess I can wait unless you still feel like the challenge! Either way, I
will set up a POP account for you and email you the details in about 12
hours when I get back from work (I'm in Malaysia - GMT+8)
Nick.
[8/8] from: bobr:dprc at: 20-Apr-2001 6:09
nick I would like a temp acct too.
I have a eudora that supports "authenticted" smtp.
If it works, I can trace the IP packets and see
what it takes.
At 08:34 AM 4/20/01 +0800, you wrote:
>Scott,
>Very many thanks for the offer, however, did you see Holger's response -
<<quoted lines omitted: 56>>
>[rebol-request--rebol--com] with "unsubscribe" in the
>subject, without the quotes.
;# mailto: [bobr--dprc--net]
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted