Greetings, Factoristas - (Slimmed-down revision of earlier bloated post)
Found a small bug in smtp.factor, and suggest a fix.
I ran into a glitch trying out the mail-ui vocab, from the recent Re:
Factor blog (mrjbq7-re-factor-ac166fe).
I did note the necessity of setting up SMTP to use gmail, though I couldn't
get that to happen via
.factor-boot-rc. Instead, I just added the set-up code to mail-ui.factor,
to be called from the
top-level word, open-compose-window:
------
USING: smtp namespaces io.sockets ;
: setup-smtp ( -- )
"cwalsto...@gmail.com" "mail-password" <plain-auth> smtp-auth set-global
"smtp.gmail.com" 587 <inet> smtp-server set-global
t smtp-tls? set-global ;
-------
~So far, so good. The 'compose' window comes up and accepts text just fine.
But clicking the 'send' button throws this error:
"Generic word aux>> does not define a method for the byte-array class.
Dispatching on object: B{ 65 85 84 72 32 80 76 65 73 78 32 65 71 78 51 ~36
more~ }"
~Error occurs where the slot accessor aux>> fails on the base64 auth
byte-array, looking for
a string instead. So, I made a small change to the send-auth method of
plain-auth in smtp.factor
to output a string rather than a byte-array and succeeded in a soliloquy
with my gmail account:
-------
M: plain-auth send-auth
[ username>> ] [ password>> ] bi
plain-auth-string
! "AUTH PLAIN " prepend command get-ok ---*CHANGED TO*:
* "AUTH PLAIN " "" prepend-as* command get-ok ;
-------
~Now I've got mail!
Cheers,
~cw
--
*~ Memento Amori*
------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk