HB_SendMail() antigos problemas resolvidos ?

Projeto [x]Harbour - Compilador de código aberto compatível com o Clipper.

Moderador: Moderadores

Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7929
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

HB_SendMail() antigos problemas resolvidos ?

Mensagem por Itamar M. Lins Jr. »

Estou postando aqui, pode ser que alguém esteja com problema ou deseja mudar para o hb_sendmail()
O fato é que tinha problemas.
Outra coisa, é muito importante relatar os possíveis problemas em alguma lista ou grupo. Pode uma pessoa achar um defeito em qualquer parte e se não informar, como é que será corrigido ?
Yes, the "BCC in the headers" bug was inherited from xHarbour 7 years ago. Viktor discovered it and fixed it in 2010:

2010-11-18 13:31 UTC+0100 Viktor Szakats (vszakats.net/harbour)
* contrib/hbtip/sendmail.prg
! Fixed to not add 'Bcc:' entry to e-mail headers, since this will
reveal all the supposedly secret addresses to all addressees.
It's interesting how such huge bug can persist for so long
time without anyone noticing.
Please test and correct if needed.

I had a quick look at the original code after you and Przemek discussed the loop that skipped the first element, and it is very obvious where that bug came from. The xHarbour 1.0.0 code loked like this:

cBCC := aBCC[1]
imax := Len( aBCC )
FOR i:=2 TO imax
cBCC += "," + InetCrlf() + Chr(9) + aBCC
NEXT

... and it was/is similar for cTo and cCC ... and xHarbour still has the same peculiar code today. The bugs were introduced in Harbour when the code was cleaned to:

cBCC := ""
imax := Len( aBCC )
FOR i := 2 TO imax
...

So, yet another TIP bug has gone unnoticed for a very long time. "To" has already been fixed, "BCC" was removed from hb_SendMail() as per the quoted changelog entry (but it still remains in the TIPMail class), and maybe Harbourers do not use "CC", where the loop bug still exists.


Regarding diff file creation, and your kindness in consistently helping
users, could you, would you, direct me in how to do that?

There was a pretty long thread with subject "arry rdd", starting on 2011-11-08, in which many messages focused on how to create diff files. I think that thread is a worth a read:


Correção já no Harbour 3.2 e 3.4

Código: Selecionar todos

014-08-21 01:11 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
  * contrib/hbtip/mail.prg
    ! fixed missing 1-st adress in CC and BCC parameters - many
       for information about the bug and patch

  * contrib/hbtip/sendmail.prg
    ! typo in comment - thanks to Heinz V Bergen too

  * src/rtl/gtwvt/gtwvt.c
    * some minor modification to sync code with Vitkor's branch

  * src/vm/hvm.c
  * src/vm/itemapi.c
    * small optimization in string comparison

best regards
Przemek
Essa é a principal razão porque eu prefiro usar as versões mais novas.
Às vezes as pessoas, podem pensar: se está funcionando para que mudar ? É! será que está funcionando tudo mesmo no [x]harbour ?
Uma coisa é funcionar tudo muito bem os comandos que usamos em nossos programas. E se um dia precisar usar um comando que naquela versão velha está com defeito ?

O Harbour é muito grande e não custa nada testar sempre uma versão mais nova para não ficarmos muito para traz

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
rossine
Usuário Nível 3
Usuário Nível 3
Mensagens: 325
Registrado em: 06 Ago 2007 09:57
Localização: Divinópolis-MG

HB_SendMail() antigos problemas resolvidos ?

Mensagem por rossine »

Olá Itamar,

Uma maneira que eu contribuo para o harbour, já que não manjo nada de C++, é estar atualizando o harbour de 2 a 3 vezes por semana e relatando algo de anormal ocorrido. Com isto fica mais fácil deles corrigirem os erros, mas tenho o costume, sempre, de guardar as versões anteriores, antes de atualizar.

T+

Rossine.
Rossine.

Harbour 3.4, MingW / Msvc, QT, Qt5xhb, GtQtc, DbfCdx, MySql/MariaDB.
Responder