Outbound email password save issue

Hi,

I am attempting to do an integration between our instances SuiteCRM and Sendgrid. For the moment I just want to use the SMTP interface of Sendgrid.

I have tested Sendgrid with a stand alone email client and can successfully send an email via the Send grid SMTP user name and password supplied by Sendgrid.

Note that for Sendgrid SMTP authentication they have a user name “apikey” and a generated password that is very long. The password is 68 characters include “.” and “_”

I can create the Outbound email account in SuiteCRM with the Sendgrid settings and credentials.

I can send a Test email when I have first created the Outbound email. The test email works. It is sent via Sendgrid. So thus the settings and credentials are correct.

If I save the Outbound email and try to use it then it doesn’t work from a Campaign.

If I edit the Outbound email again and try to send a Test email then that does NOT work.

If I re-enter the password then the Test email works again.

From this I am assuming that there is something wrong with the saving and loading of the password from the database.

Is there any way for me to diagnose this further?

Thanks.

I’m debugging a different issue but my problem involves the REQUEST parameters getting changed for over-zealous XSS protection purposes, and that ruins the data. I’m guessing you might be getting the same problem.

Are you a PHP developer? The below is a hack to add a calcDelta function that checks the differences between the raw request and the “clean” one. If your password field is getting changed, then that’s probably a bug.

Add this function somewhere in include/utils.php:

function calcDelta($a1, $a2)
{

    //combine into a nice associative array:
    $delta=Array();
    foreach ($a1 as $key=>$value) {
        if ($a1[$key] != $a2[$key])
            $delta[$key] =  ("Was ". $a1[$key]. ", became " . $a2[$key]);
    }
    //$num = count($data);

    if (empty($a1)) $delta[] = array("a1" => ("Was empty"));
    if (empty($a2)) $delta[] = array("a2" => ("Was empty"));

    return $delta;
}

Then in that same file, right before the end of function clean_incoming_data, right before the return 0, add

    $delta = calcDelta($RAW_REQUEST, $_REQUEST);

You need to set a breakpoint at that final line with return 0; to inspect the $delta variable.

I hope this helps you troubleshoot…