[REBOL] Re: Sending mails & authentification
From: Gary:Jones:usap:gov at: 31-Mar-2004 14:14
Re: Sending mails & authentification
Hi, Robert,
I'm down at the south pole, and we've had satellite problem that has made it very difficult
to keep up with the list. I just happened to check the discussion list and noticed
your problem.
The REBOL interpreter used to be more aggressive in its evaluation of expressions, and
my 2001 esend and esmtp took advantage of the evaluation. The newer versions of REBOL
over the last couple of years are less aggressive, so last year I change the patch and
found an easier way to apply it. This patch is looks for the authentication requests
and feeds the username and password, when appropriate:
system/schemes/smtp/handler/open-check: [none "220" ["EHLO" system/network/host] "250"
"AUTH LOGIN" "334" [port/user] "334" [port/pass] "235"]
Then, I would throw the following view script in front of any script that used Exchange
email. Note that the script encodes the username and password in base 64, which is required
by MS Exchange Server. You may of course replace "MSusername" with the default that you
would like presented. Hitting return key advances the field and does final entry.
view lo: layout [
text "username"
f: field "MSusername" [
system/schemes/smtp/user: copy enbase/base value 64
]
text "password"
field hide [
system/schemes/smtp/pass: copy enbase/base value 64
unview/all
]
do [focus f]
]
Then, you should be able to use the regular send command for email. With luck, this
method will still work for MS Exchange (5.5 at least).
HOWEVER, it appears as though your smtp server may want a *plain* authentication, meaning
no encoding. If so, then you may wish to try:
view lo: layout [
text "username"
f: field "username" [
system/schemes/smtp/user: copy value
]
text "password"
field hide [
system/schemes/smtp/pass: copy value
unview/all
]
do [focus f]
]
This version passes the unencoded versions of the username and password.
Hope that this helps.
--Scott Jones