星期五, 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

星期二, 1月 26, 2010

尾牙

2/9 晚上7:00

帝王食補紅面薑母鴨(志廣店)
桃園縣中壢市志廣路80號

http://www.ptt.cc/man/Food/DA58/D90C/D39E/M.1214518090.A.AE7.html

星期五, 1月 22, 2010

蘿蔔等十字花科蔬菜

近年來科學家們發現,蘿蔔等十字花科蔬菜進入人體後,經代謝很快就會產生一種抗甲狀腺的物質∼硫氰酸。該物質產生的多少與攝入量成正比。此時,如果攝入含大量植物色素的水果如橘子、梨、蘋果、葡萄等,這些水果中的類黃酮物質在腸道被細菌分解,轉化成羥苯甲酸及阿魏酸,它們可加強硫氰酸抑制甲狀腺的作用,從而誘發或導致甲狀腺腫。

星期三, 1月 20, 2010

2>&1

兩者效果有啥不同
  • system("/bin/led_flash.sh flash 100000 2>&1 &");
  • fp = popen( "/bin/led_flash.sh flash 100000 2>&1 &", "r");
    pclose( fp );

在使用CGI 時有很大的不同, 一個會動一個不會動

星期一, 12月 28, 2009

opendir & readdir

#include
#include
#include
#include

int main(){
char path[]="/sys/bus/mmc/devices/";
DIR * dir;
struct dirent * ptr;
int i;
dir =opendir( path );
while((ptr = readdir(dir))!=NULL) {
if( !strncmp( ptr->d_name,"mmc0", 4) ) printf("d_name: %s\n",ptr->d_name);

}
closedir(dir);
}

星期四, 12月 24, 2009

力線通訊轉Wi-Fi的802.11n

盛達電業日前推出了首款電力線通訊轉Wi-Fi的802.11n標準的網路橋接器,該款產品名為BiPAC 2073,是目前市場上還很少見的產品
http://www.ithome.com.tw/itadm/article.php?c=58737