星期五, 3月 19, 2010

SMTP 認證問題: Client does not have permission to Send As this sender

SMTP client 失敗原因, 很多套都是,以現在很多都開啟 SMTP 驗證 server來說...

smtpAuthLogin(dsocket *sd, const char *user, const char *pass)
{
int retval = 0;
dstrbuf *data;
dstrbuf *rbuf = DSB_NEW;

data = mimeB64EncodeString((u_char *)user, strlen(user), false);
if (writeResponse(sd, "AUTH LOGIN %s\r\n", data->str) < 0) {
smtpSetErr("Socket write error: smtp_auth_login");
retval = ERROR;
goto end;
}

#ifdef DEBUG_SMTP
printf("--> AUTH LOGIN\n");
fflush(stdout);
#endif

retval = readResponse(sd, rbuf);
if (retval != 334) {
if (retval != ERROR) {
smtpSetErr(rbuf->str);
}
retval = ERROR;
goto end;
}

#ifdef DEBUG_SMTP
printf("<-- %s\n", rbuf->str);
fflush(stdout);
#endif

/* Encode the password */
dsbDestroy(data);



AUTH LOGIN %s
拆成兩個動作,以兩次的command 來回,就可以解決這個問題了

  • Client does not have permission to Send As this sender
Reference:
  • SmtpClient 身份验证失败(authentication failed) 的原因分析
  • email-3.1.2 ( smtpcommands.c )

星期五, 3月 12, 2010

netcat (Windows)

http://www.securityfocus.com/tools/139
netcat (Windows)

nc -L -p 888 , Listen port 888

星期二, 3月 02, 2010

找Paper的好地方

MicroSoft 找Paper,Reference 直接點,不用東找西找了
  • http://academic.research.microsoft.com/Paper/1239741.aspx