Discussions related to Visual Prolog
larryhoughton
Posts: 11
Joined: 4 Oct 2016 21:16

Outlook 365 email requires "starttls = true" parameter

Unread post by larryhoughton »

Hello,
Update: GoDaddy has given me a port 25 option that may be a work-around for now....

I need to include email output in my VP application. "sendMail_smtp.pro" was perfect right up to point where I found out the GoDaddy Outlook 365 smtp server I'd like to use requires a setting that the VP sendMail doesn't have; starttls = true.

mailServer:=sendMail_smtp::new("smtp.office365.com","myGoDaddyEmailDomain.com"),
mailServer:smtpPort:=587,

Part of the fun is the username and password have to be encrypted like so:
C:\OpenSSL\bin>echo info@myGoDaddyEmailDomain.com|openssl enc -base64
mb0BteXNoaWZ0d2F

The way things are now I don't get the chance to use the encrypted Username or Password; the Outlook 365 server errors out with:

Code: Select all

eMail Token: 220 Message=:EHLO myGoDaddyEmailDomain.com eMail Token: 250 AUTH LOGIN hjashjifhasfhjsa (I send AUTH LOGIN and the encrypted email Username) eMail Token: 504 (and get back 504 unrecognized authentication type) ========================================  Dump: 2018-02-04 10:20:18 ---------------------------------------- Exception: sendMailException (sendMail_smtp)  Continued exception in sendMail package  Predicate name = readLine  SourceCursor = pfc\web\sendMail_smtp\sendMail_smtp.pro(113,13)  Server Response = 504 5.7.4 Unrecognized authentication type [DM5PR0102CA0001.prod.exchangelabs.com] raised 2018-02-04 10:20:18 ThreadId: 6100 Class name: sendMail_smtp Predicate name: readLine

Here is the pertinent code to recreate the error. It includes slight modification/addition to have sendMail_smtp.pro send "AUTH LOGIN" to Outlook 365:

Code: Select all

constants username="kjhkhjaskfhh the encrypted Username". password="sgdsf25gfsfg the encrypted password". predicates     sendEmail : (socket Socket). clauses     sendEmail(SOCKET) :-     Message_AUTH_LOGIN = string::concat("AUTH LOGIN ", username,"\r\n"),     msglayer::msglay_WriteStr(SOCKET,  Message_AUTH_LOGIN),     stdio::write(Message_AUTH_LOGIN),     readLine(SOCKET),   %The 504 error has already occurred at this point....       Message_Password = string::concat(password, "\n"),     msglayer::msglay_WriteStr(SOCKET, Message_Password),     stdio::write(Message_Password),     readLine(SOCKET),       Message_MAIL_FROM = string::concat("MAIL FROM:","info@myGoDaddyEmailDomain.com", "\r\n"),     msglayer::msglay_WriteStr(SOCKET, Message_MAIL_FROM),     stdio::write(Message_MAIL_FROM,"\n"),     readLine(SOCKET),    
What can we do??
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Re: Outlook 365 email requires "starttls = true" parameter

Unread post by Thomas Linder Puls »

My immediate reaction is: "starttls=true" sounds like the communication must use a secure (=encrypted) socket connection. And the SMTP layer does not support that.
Regards Thomas Linder Puls
PDC
larryhoughton
Posts: 11
Joined: 4 Oct 2016 21:16

Re: Outlook 365 email requires "starttls = true" parameter

Unread post by larryhoughton »

Yes, startttls is SSL. I'm not sure if the requirement is only an encrypted username and password or if the entire "session" has to be SSL (and therefore SSL certificates would be required too, ugh).
The mission is to simply send emails from a Amazon AWS hosted EC2 server running VP.
Amazon's eMail service requires SSL so I bought a GoDaddy email account which has a non SSL option on port 25, however that option uses the sources' IP or domain for authentication and so far I haven't been able to get that to work (since I'm not hosted at GoDaddy).
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Re: Outlook 365 email requires "starttls = true" parameter

Unread post by Thomas Linder Puls »

SSL is acronym for Secure Socket Layer. And TLS for Transport Layer Security.

You can safely assume that it is not just username/password, but the entire communication.
Regards Thomas Linder Puls
PDC
creiglee
Posts: 1
Joined: 20 Mar 2018 6:13

Re: Outlook 365 email requires "starttls = true" parameter

Unread post by creiglee »

I actually have used a simpler method that seems to work for us:

outbound: smtp.office365.com

SMTP server port: 587

Encryption: TLS

And of course use an O365 account with a license for Exchange.

We use it for a few tools and haven't had any issue yet, but it may not be what you need - just throwing it out there.
Post Reply