Witam!
Mam problem z napisaniem klienta smtp pod linuxa. Poniższy kod


        read(sock,buf_read,1024);
    printf("%s\n",buf_read);

    strcpy(buf_write,"EHLO spectrum.akademiki.lublin.pl\r\n");
    write(sock,buf_write,strlen(buf_write)+1);
    printf(buf_write);
    read_bytes=read(sock,buf_read,1024);
    buf_read[read_bytes]='\0';
    printf("%s\n",buf_read);

    strcpy(buf_write,"MAIL FROM:[email protected]\r\n");
    write(sock,buf_write,strlen(buf_write)+1);
    printf(buf_write);
    read_bytes=read(sock,buf_read,1024);
    buf_read[read_bytes]='\0';
    printf("%s\n",buf_read);

daje taki efekt:

EHLO spectrum.akademiki.lublin.pl
250-liza.umcs.lublin.pl Hello [email protected] [212.182.58.98], pleased to meet you
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-SIZE 2000000
250-DSN
250-ONEX
250-ETRN
250-XUSR
250-AUTH LOGIN PLAIN
250 HELP

MAIL FROM:[email protected]
500 5.5.1 Command unrecognized: ""

Natomiast kiedy nie wysylam ELHO:

       read(sock,buf_read,1024);
    printf("%s\n",buf_read);

    strcpy(buf_write,"MAIL FROM:[email protected]\r\n");
    write(sock,buf_write,strlen(buf_write)+1);
    printf(buf_write);
    read_bytes=read(sock,buf_read,1024);
    buf_read[read_bytes]='\0';
    printf("%s\n",buf_read);

dostaję:
220 liza.umcs.lublin.pl ESMTP Sendmail 8.11.6/8.11.6; Tue, 27 Apr 2004 22:38:45 +0200

MAIL FROM:[email protected]
250 2.1.0 [email protected]... Sender ok

Czy ktoś wie o co tu chodzi?