Our site www.viart.com site is operated by latest Viart Shop 5 with default Clear design
Topic Information
scendix
scendix
I found a serious bug in the va_mail() function of current 4.0.5:
base64_decode("QVVUSCBMT0dJTlxyXG4=") decodes into “AUTH LOGIN\r\n” with the “\” quoted as “\\” = “AUTH LOGIN\\r\\n”
and some other wrong “\r\n” at the end after “RCPT TO".
 
These values are rejected by the SMTP server so that the emails can’t be send.
 
There is no easy workaround for this. As va_functions.php is scrambled, you would need to change multiple things.
 
Perhaps Viart could do a bugfix?
 
scendix
scendix
here is a fix (try at your own risk):
 
- open includes/va_functions.php
- replace all occurrences of "fputs(" with "fputs_new("
- add this code BEFORE the closing ?>:
 
function fputs_new( &$handle , $string, $length = 0 )
{
$string = str_replace("\\r\\n", "\r\n", $string);
if(substr($string, -2) == "\r\n")
$string = substr($string, 0, -2);
return fputs($handle , $string."\r\n");
}
 
Then your 4.0.5 should be able to send emails via SMTP.
 
 
-Christoph
 
TOCDCO
TOCDCO
scendix:
 
can you email me?
 
daniel[dot]risch[at]tocdco[dot]com
 
scendix
scendix
email what?
the hotfix is described above...
 
-Christoph
 
TOCDCO
TOCDCO
I was going to ask you a question, but that's okay if you cannot
 
Vera
Vera
Yes, you have identified the bug correctly BUT changing only this one file with the error can break other scripts as there exists a tie-in algorithm between encoded scripts. That's why if you experience similar problem please download the WHOLE patch from here:
http://www.viart.com/fix_for_va_mail_function_causing_SMTP_problems.html
 
scendix
scendix
Yes, that's why I did not post any file, but only described on how to apply the hotfix to your own php file.
This will not break any other scripts or integration.
 
Good that you have made a fix available.
 
BTW, no need to say thank you. I loved to invest hours of debugging and searching for this bug in your product and then sharing the solution with you and the other users here...
 
-Christoph