Secure SMTP using STARTTLS

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

Secure SMTP using STARTTLS

Postby PhilGray on Sun Sep 12, 2010 8:41 am

Has anyone written a "Secure" SMTP server or client recently ?

I wrote some normal SMTP functions years ago, and discovered ( after reusing the code yesterday ) that Googlemail for example now requires TLS with SMTP .

STARTTLS initiates encrypted hand-shaking between client and server.

Just wondering whether anyone has already done this ?
... or can .Net provide the functionality for this ?




SMTP Service Extension for Secure SMTP over TLS
http://www.rfc-editor.org/rfc/rfc2487.txt

Wiki - STARTTLS
http://en.wikipedia.org/wiki/STARTTLS

The Transport Layer Security (TLS) Protocol
http://tools.ietf.org/html/rfc5246
PhilGray
 
Posts: 50
Joined: Sat Mar 13, 2010 7:55 pm

Re: Secure SMTP using STARTTLS

Postby MBaas on Sun Mar 23, 2014 4:33 pm

Hi Phil,

did you get any answer or have you found a solution? I'm looking at the same problem right now ;)

Thanks

Michael
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany

Re: Secure SMTP using STARTTLS

Postby PhilGray on Tue Apr 01, 2014 5:19 pm

Hi Michael,
I didn't bother to follow it up as I expected that someone might answer , thus saving time & effort. Seems as if nobody has been there yet.
Cheers
Phil
PhilGray
 
Posts: 50
Joined: Sat Mar 13, 2010 7:55 pm

Re: Secure SMTP using STARTTLS

Postby MBaas on Tue Apr 01, 2014 7:41 pm

Thanks, Phil. How sad :((

Is anyone from Dyalog listening? This should be a project for one of your youngsters - it can't be that "nobody has ever been there" (in 2014)!

Cheers

Michael
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany

Re: Secure SMTP using STARTTLS

Postby PhilGray on Tue Apr 01, 2014 10:34 pm

Michael,
I agree , although my guess is that most people are probably using DotNet these days .. where the "wheel" doesn't have to be reinvented but is available in some Library.
Hint .. some input or tips from the Dyalog guys would be helpful here.
;-)
PhilGray
 
Posts: 50
Joined: Sat Mar 13, 2010 7:55 pm

Re: Secure SMTP using STARTTLS

Postby Vince|Dyalog on Wed Apr 02, 2014 2:06 pm

Hi Phil,

I found this webpage which may be of interest:

http://msdn.microsoft.com/en-us/library/system.security.authentication.sslprotocols(v=vs.110).aspx
Regards,

Vince

[Post updated to fix URL - thanks Phil!]
Vince|Dyalog
 
Posts: 414
Joined: Wed Oct 01, 2008 9:39 am

Re: Secure SMTP using STARTTLS

Postby PhilGray on Wed Apr 02, 2014 3:27 pm

Thanks Vince .. dead-link somehow.

I guess you meant this one ?

http://msdn.microsoft.com/en-us/library/system.security.authentication.sslprotocols(v=vs.110).aspx

Seems that .net Framework 4.5 supports TLSv1.2
PhilGray
 
Posts: 50
Joined: Sat Mar 13, 2010 7:55 pm

Re: Secure SMTP using STARTTLS

Postby MBaas on Sun May 25, 2014 9:41 am

The following should help (requires .net 4.5)
      ⎕USING←'System.Net.Mail,System.dll' 'System,System.dll' 'System.Net,system.dll'
MyMail←MailMessage.New ⍬
MyMail.To.Add ⎕NEW MailAddress,⊂'bill@microsoft.com'
MyMail.From←⎕NEW MailAddress,⊂'sales@dyalog.com'
MyMail.Subject←'Your 500 licences of Dyalog APL'
MyMail.Body←'Thanks, Bill. Nice to see you returning to APL :)'
Mailer←⎕NEW SmtpClient(,⊂'smtp.dyalog.com')(587) ⍝ SMTP-Server and port
Mailer.EnableSSL←1
Cred←⎕NEW NetworkCredential('smtp_USERNAME' 'smtp_PASSWORD')
Mailer.UseDefaultCredentials←0
Mailer.Credentials←Cred
Mailer.Send MyMail
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany

Re: Secure SMTP using STARTTLS

Postby Dick Bowman on Tue Nov 11, 2014 3:23 pm

That didn't quite work for me (LENGTH ERRORs) needed to change lines...

Code: Select all
 MyMail.To.Add ⎕NEW MailAddress,⊂'bill@microsoft.com'
 MyMail.From←⎕NEW MailAddress,⊂'sales@dyalog.com'

to
Code: Select all
 MyMail.To.Add ⎕NEW MailAddress (⊂'bill@microsoft.com')
 MyMail.From←⎕NEW MailAddress (⊂'sales@dyalog.com')
Visit http://apl.dickbowman.com to read more from Dick Bowman
User avatar
Dick Bowman
 
Posts: 235
Joined: Thu Jun 18, 2009 4:55 pm


Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest