} else if (pish->useAUTHLOGIN) {
} else if (pish->flags & useAUTHLOGIN) {
sendSMTPStart(ptcx_t ptcx, mail_command_t *cmd, cmd_stats_t *ptimer){    doSMTP_state_t	*me = (doSMTP_state_t *)mycalloc (sizeof (doSMTP_state_t));    char	respBuffer[MAX_RESPONSE_LEN];    char	command[MAXCOMMANDLEN];    int		numBytes;    int		rc;    pish_command_t	*pish = (pish_command_t *)cmd->data;    pish_stats_t	*stats = (pish_stats_t *)ptimer->data;    if (!me) return NULL;    event_start(ptcx, &stats->connect);    ptcx->sock = connectSocket(ptcx, &pish->hostInfo, "tcp");    event_stop(ptcx, &stats->connect);    if (BADSOCKET(ptcx->sock)) {	if (gf_timeexpired < EXIT_FAST) {	    stats->connect.errs++;	    returnerr(debugfile, "%s SMTP Couldn't connect to %s: %s\n",		      ptcx->errMsg, pish->hostInfo.hostName, neterrstr());	}	myfree (me);	return NULL;    }    if (gf_abortive_close) {	if (set_abortive_close(ptcx->sock) != 0) {	    returnerr (debugfile, "SMTP: WARNING: Could not set abortive close\n");	}    }    /* READ connect response from server */    event_start(ptcx, &stats->banner);    numBytes = readResponse(ptcx, ptcx->sock, respBuffer, sizeof(respBuffer));    event_stop(ptcx, &stats->banner);    if (numBytes <= 0) {	if (gf_timeexpired < EXIT_FAST) {	    stats->banner.errs++;	    returnerr(debugfile,"%s SMTP Error reading banner: %s\n",		      ptcx->errMsg, neterrstr());	}	doSMTPExit (ptcx, me);	return NULL;    }    if (isSmtpResponseOK(respBuffer) == 0) {	if (gf_timeexpired < EXIT_FAST) {	    stats->banner.errs++;	    returnerr(debugfile, "%s Got SMTP ERROR response [%.99s]\n",		      ptcx->errMsg, respBuffer);	}	doSMTPExit (ptcx, me);	return NULL;    }    D_PRINTF(debugfile,"read connect response\n");    if (pish->useEHLO != 0) {	/* send extended EHLO */	sprintf(command, "EHLO %s" CRLF, gs_thishostname);    } else {	/* send normal HELO */	sprintf(command, "HELO %s" CRLF, gs_thishostname);    }    event_start(ptcx, &stats->cmd);    rc = doSmtpCommandResponse(ptcx, ptcx->sock, command, respBuffer, sizeof(respBuffer));    event_stop(ptcx, &stats->cmd);    if (rc == -1) {	if (gf_timeexpired < EXIT_FAST) {	    stats->cmd.errs++;	    trimEndWhite (command);	    returnerr(debugfile, "%s SMTP HELO/EHLO [%.99s] ERROR reading response [%.99s]\n",		      ptcx->errMsg, command, respBuffer);	}	doSMTPExit (ptcx, me);	return NULL;    }    if (pish->useAUTHPLAIN) {	/* look for AUTH PLAIN LOGIN in respBuffer */	if (strstr(respBuffer, "AUTH PLAIN LOGIN") != NULL) {	    /* FIX: time get base64 time and multiple round trips */	    rc = smtpAuthPlain(ptcx, cmd, ptimer, ptcx->sock);	    if (rc != 0) {		doSMTPExit (ptcx, me);		return NULL;	    }	}    } else if (pish->useAUTHLOGIN) {	/* look for AUTH LOGIN in respBuffer */	if (strstr(respBuffer, "AUTH=LOGIN") != NULL) {	    /* FIX: time get base64 time and multiple round trips */	    rc = smtpAuthLogin(ptcx, cmd, ptimer, ptcx->sock);	    if (rc != 0) {		doSMTPExit (ptcx, me);		return NULL;	    }	}    }    return me;}