<div>I'm still getting no joy with this.</div>
<div> </div>
<div>I've attached my test script, and will try on a different network (in case it's my proxy server doing the damage)</div>
<div> </div>
<div>-:(-</div>
<div>Welcome to DrRacket, version 5.1 [3m].<br>Language: racket; memory limit: 128 MB.<br>"Failed with reason::#(struct:exn:fail:network tcp-connect: connection to <a href="http://smtp.gmail.com">smtp.gmail.com</a>, port 465 failed (at step 6: No connection could be made because the target machine actively refused it.; errno=10061) #<continuation-mark-set>)"</div>
<div>---</div>
<div><br><br> </div>
<div class="gmail_quote">On Tue, Mar 8, 2011 at 8:20 AM, Stephen De Gabrielle <span dir="ltr"><<a href="mailto:spdegabrielle@gmail.com">spdegabrielle@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>Thanks Greg, </div>
<div> </div>
<div>I'll test your patch against the Exchange server I'm wanting to connect to. <br></div><font color="#888888">
<div>S.</div></font>
<div>
<div></div>
<div class="h5">
<div><br> </div>
<div class="gmail_quote">On Mon, Mar 7, 2011 at 9:20 PM, Greg Hendershott <span dir="ltr"><<a href="mailto:greghendershott@gmail.com" target="_blank">greghendershott@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>> Does anyone have an example of using #:tls-encode (net/smtp)?<br><br></div>No, in fact I'm seeing it fail today with an SMTP server that requires<br>TLS on port 587.<br><br>The reason seems to be that the server is expecting AUTH LOGIN whereas<br>
net/smtp only does AUTH PLAIN.<br><br>I was able to get it to work (with this particular server) by making a<br>local copy of smtp-send-message from net/smtp-unit.rkt and modifying<br>lines 96-103:<br><br> (when auth-user<br>
(log "auth\n")<br> (fprintf w "AUTH PLAIN ~a"<br> ;; Encoding adds CRLF<br> (base64-encode<br> (string->bytes/latin-1<br> (format "~a\0~a\0~a" auth-user auth-user auth-passwd))))<br>
(check-reply r 235 w))<br><br>to be this instead:<br><br> (when auth-user<br> (if tls-encode<br> (begin<br> (log "auth login\n")<br> (fprintf w "AUTH LOGIN\r\n")<br>
(check-reply r 334 w)<br> (fprintf w "~a" ;encoding adds CRLF<br> (base64-encode<br> (string->bytes/latin-1 auth-user)))<br> (check-reply r 334 w)<br>
(fprintf w "~a" ;encoding adds CRLF<br> (base64-encode<br> (string->bytes/latin-1 auth-passwd)))<br> (check-reply r 235 w))<br> (begin<br>
(log "auth plain\n")<br> (fprintf w "AUTH PLAIN ~a" ;encoding adds CRLF<br> (base64-encode<br> (string->bytes/latin-1<br> (format "~a\0~a\0~a" auth-user auth-user auth-passwd))))<br>
(check-reply r 235 w))))<br><br>i.e. I tried to keep the AUTH PLAIN case while providing AUTH LOGIN on<br>the assumption it will always be wanted when doing TLS. I don't deeply<br>know the SMTP protocol. This is based on me observing one specific<br>
server and guessing what would work. That said, I hope this may help.<br>
<div>
<div></div>
<div><br><br>On Fri, Feb 4, 2011 at 7:51 AM, Stephen De Gabrielle<br><<a href="mailto:spdegabrielle@gmail.com" target="_blank">spdegabrielle@gmail.com</a>> wrote:<br>> Hi,<br>><br>> Does anyone have an example of using #:tls-encode (net/smtp)?<br>
><br>> Cheers,<br>><br>> Stephen<br>><br>> --<br>> Stephen De Gabrielle<br>> <a href="mailto:stephen.degabrielle@acm.org" target="_blank">stephen.degabrielle@acm.org</a><br>> Telephone +44 (0)20 85670911<br>
> Mobile +44 (0)79 85189045<br>> <a href="http://www.degabrielle.name/stephen" target="_blank">http://www.degabrielle.name/stephen</a><br>><br></div></div>> _________________________________________________<br>
> For list-related administrative tasks:<br>> <a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br></blockquote></div><br><br clear="all"><br></div>
</div>-- <br>
<div>
<div></div>
<div class="h5"><br>--<br>Stephen De Gabrielle<br><a href="mailto:stephen.degabrielle@acm.org" target="_blank">stephen.degabrielle@acm.org</a><br>Telephone +44 (0)20 85670911<br>Mobile +44 (0)79 85189045<br><a href="http://www.degabrielle.name/stephen" target="_blank">http://www.degabrielle.name/stephen</a><br>
<br></div></div></blockquote></div><br><br clear="all"><br>-- <br><br>--<br>Stephen De Gabrielle<br><a href="mailto:stephen.degabrielle@acm.org">stephen.degabrielle@acm.org</a><br>Telephone +44 (0)20 85670911<br>Mobile +44 (0)79 85189045<br>
<a href="http://www.degabrielle.name/stephen">http://www.degabrielle.name/stephen</a><br><br>