Page 6 of 7

Harbour ChangeLog - Relevant for HMG interest

Posted: Wed Dec 07, 2016 10:27 am
by Pablo César
Claudio, tus trabajos son siempre sorprendentes. Despertaste el interés de todos aqui, inclusive del jefe.

Pero ya que anunciaste algo que está en andamiento y te hicieron preguntas. Yo quisiera hacer una más.

En Harbour mandar emails, es algo poco prático por no decir que es espinoso de complicado cuando se refiere a direcciones que usan SSL.

Si bien que contamos con una biblioteca OPEN SOURCE que es utilizado por várias herramientas por ai... pero por lo que me parece (puedo estar equivocado) las versiones no se encuentran en sintonia o mejor dicho hay una carencia de informacion extraordinária con respecto a las bibliotecas SSL y Harbour. Inclusive en mi opinion personal, que yo como muchos, no me gusta utilizar DLLs.

Mi pregunta es: este proyecto, contempla alguna rutina de SSL ?

Yo imagino que si... :)
Porque de alli en más, en HMG estaríamos libres del uso de esas bibliotecas tan complicadas. O mejor, dejando de usar bibliotecas dinámicas o dependencia de bibliotecas externas... Puede ser ?

--- Googled ---

Claudio, your work is always surprising. You aroused everyone's interest here, including the boss.

But since you announced something that is in progress and they asked you questions. I would like to do one more.

In Harbour send emails, it is somewhat impractical not to say that it is daunting of complicated when it refers to address that use SSL.

While we have an OPEN SOURCE library that is used by various tools there ... but for what it seems (I may be wrong) the versions are not in tune or rather there is a lack of extraordinary information regarding SSL and Harbour libraries. Even in my personal opinion, that I like many, I do not like to use DLLs.

My question is: Does this project contemplate any SSL routine ?

I imagining... YES... :)
Because from there on, in HMG we would be free of the use of such complicated libraries. Or better, not using dynamic libraries or external libraries dependency... Can it be possible ?

Re: Harbour ChangeLog - Relevant for HMG interest

Posted: Wed Dec 07, 2016 11:39 am
by srvet_claudio
Pablo,
no, the server only use the TCP/IP protocol without any type of certification.

Re: Harbour ChangeLog - Relevant for HMG interest

Posted: Wed Dec 07, 2016 1:33 pm
by Pablo César
srvet_claudio wrote:no, the server only use the TCP/IP protocol without any type of certification.
Own, what a pity :|

Re: Harbour ChangeLog - Relevant for HMG interest

Posted: Thu Dec 08, 2016 1:00 am
by srvet_claudio
Pablo César wrote:
srvet_claudio wrote:no, the server only use the TCP/IP protocol without any type of certification.
Own, what a pity :|
If the Harbour team could not make it work simple and safe, I doubt I can do it better.

Harbour ChangeLog - Relevant for HMG interest

Posted: Thu Dec 08, 2016 2:29 pm
by Pablo César
I understand. Yet everything seems so confusing ... if you can not, imagine us here mere mortals ...

The problem that in Harbour 3.4 has been talking about for some time from TSL with tip_MailSend to send via OutLook and in our Harbour, still nothing... :|

Here's how Viktor increased:

Code: Select all

/* Copyright 2009 Viktor Szakats (vszakats.net/harbour) */

#require "hbssl"
#require "hbtip"

#if ! defined( __HBSCRIPT__HBSHELL )
REQUEST __HBEXTERN__HBSSL__
#endif

#include "simpleio.ch"

Function Main( cFrom, cPassword, cTo, cHost )
LOCAL nPort
LOCAL lSTARTTLS := .F.

IF ! tip_SSL()
  ? "Error: Requires SSL support"
  RETURN
ENDIF

hb_default( @cFrom  ,   "<from@example.net>" )
hb_default( @cPassword, "password" )
hb_default( @cTo   ,    "to@example.com" )
hb_default( @cHost  ,   "localhost" )

cHost := Lower( cHost )

/* SMTPS works with SSL/TLS on port 465 and with STARTTLS
  on port 587. STARTTLS mode is fully automatic and requires
  SSL/TLS be disabled at first (it will be activated on
  request after STARTTLS command) */

DO CASE
   CASE cHost == "apple" .OR. "@icloud.com" $ cFrom .OR. "@mac.com" $ cFrom .OR. "@me.com" $ cFrom
        cHost := "smtp.mail.me.com"; lSTARTTLS := .T.
   CASE cHost == "fastmail" .OR. "@fastmail.com" $ cFrom .OR. "@fastmail.fm" $ cFrom
        cHost := "smtp.fastmail.com"
   CASE cHost == "gmx.net" .OR. "@gmx.net" $ cFrom .OR. "@gmx.ch" $ cFrom .OR. "@gmx.de" $ cFrom
        cHost := "mail.gmx.net"; lSTARTTLS := .T.
   CASE cHost == "google" .OR. "@gmail.com" $ cFrom .OR. "@googlemail.com" $ cFrom
        cHost := "smtp.gmail.com"
   CASE cHost == "mail.ru" .OR. "@mail.ru" $ cFrom
        cHost := "smtp.mail.ru"
   CASE cHost == "netease" .OR. "@163.com" $ cFrom
        cHost := "smtp.163.com"
   CASE cHost == "office365"
        cHost := "smtp.office365.com"; lSTARTTLS := .T.
   CASE cHost == "outlook" .OR. "@outlook.com" $ cFrom .OR. "@hotmail.com" $ cFrom
        cHost := "smtp-mail.outlook.com"; lSTARTTLS := .T.
   CASE cHost == "sina" .OR. "@sina.com" $ cFrom
        cHost := "smtp.vip.sina.com"
   CASE cHost == "uol" .OR. "@uol.com.br" $ cFrom
        cHost := "smtps.uol.com.br"
   CASE cHost == "yahoo" .OR. "@yahoo.com" $ cFrom
        cHost := "smtp.mail.yahoo.com"
   CASE ":" $ cHost
        IF TUrl():New( cHost ):nPort != -1
           nPort := TUrl():New( cHost ):nPort
        ENDIF
        lSTARTTLS := ( nPort == 587 )
        cHost := TUrl():New( cHost ):cServer
ENDCASE

hb_default( @nPort, iif( lSTARTTLS, 587, 465 ) )

? "Host:", cHost, hb_ntos( nPort ), iif( lSTARTTLS, "(STARTTLS)", "" )

? tip_MailSend( cHost,           ;
                nPort,           ;
                cFrom,           ;
                cTo,             ;
                NIL,             ;  /* CC         */
                {},              ;  /* BCC        */
                "text: body",    ;
                "text: subject", ;
                NIL,             ;  /* attachment */
                cFrom,           ;
                cPassword,       ;
                "",              ;
                NIL,             ;  /* nPriority  */
                NIL,             ;  /* lRead      */
                .T.,             ;  /* lTrace     */
                .F.,             ;
                NIL,             ;  /* lNoAuth    */
                NIL,             ;  /* nTimeOut   */
                NIL,             ;  /* cReplyTo   */
                nPort == 465 )

Return Nil
I wanted to see myself free from using LibEay32.dll and SSLeay32.dll but it looks like it still needs a lot to evolve ...

Harbour ChangeLog - Relevant for HMG interest

Posted: Fri Dec 09, 2016 10:40 am
by Pablo César
srvet_claudio wrote:If the Harbour team could not make it work simple and safe, I doubt I can do it better.
Hi Claudio, sorry for insisting on this point. But as you've seen, Harbour itself has many variations (due to the non-trivial nature of internet protocols) to send emails and does so through: SLL / TSL / CDO / CURL. At least it's just now wanting for good working... but the solutions so far have been featured on Viktor's fork Harbour version.

Most servers require a security protocol and use third-party library and still in the form of DLLs so most HMG users find it uncomfortable to update such libraries. It changes the functions of the Harbour, changes the versions of the SSL libraries, there we have to go to keep up to date. This causes a certain annoyance and certainty deficulty, since not all are advanced users.

That's why I think it's important for you to think for a future to make our own library. Both for shipping and for the issue of certification and security (if possible) of course.

At moment, I'm looking at how to send via CURL which seems to be the most guaranteed and simple. It uses a container file for certification given by the PEM file that is public and provided by Mozilla. This is the file: https://curl.haxx.se/ca/cacert.pem

In the public site has material regarding: https://curl.haxx.se/docs/caextract.html
Very useful for anyone who wants to develop something about it.

I am mentioning, since Apache uses this feature in some situations and it may be of interest to you, since you are designing a server.
Here is another concept about: http://pt.stackoverflow.com/questions/5 ... cacert-pem

There is a lot of material about it: https://docs.bolt.cm/3.0/howto/curl-ca-certificates

Well, I do not want to bother you anymore with this matter. It is something to be thought of and calm. And now what matters is his new project in which I am very anxious also to see more this conquest allied with JMG.

Re: Harbour ChangeLog - Relevant for HMG interest

Posted: Sun Dec 11, 2016 2:09 am
by srvet_claudio
Pablo, I am honestly focused only on the development of an http deamon.

Harbour ChangeLog - Relevant for HMG interest

Posted: Sun Dec 11, 2016 3:15 am
by Pablo César
Tudo bem, Claudio.

Go ahead please. :)

Harbour ChangeLog - Relevant for HMG interest

Posted: Tue Dec 13, 2016 11:36 am
by Pablo César
13 years old bug :o
Screen33.png
Screen33.png (33.29 KiB) Viewed 2928 times
Solved in Viktor's fork.

By the other hand...
Screen34.png
Screen34.png (26.88 KiB) Viewed 2927 times
I think version 3.2 is dying ...

Maybe give way to 3.4 ...

Harbour ChangeLog - Relevant for HMG interest

Posted: Fri Dec 16, 2016 10:01 am
by Pablo César
Uff, until finally something new in our Harbour...

New functions for time convertions:
Screen43.png
Screen43.png (24.78 KiB) Viewed 2859 times