]> granicus.if.org Git - curl/commitdiff
first shot at actually doing the SMTP upload as well, not doing the proper
authorDaniel Stenberg <daniel@haxx.se>
Fri, 25 Dec 2009 22:50:11 +0000 (22:50 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 25 Dec 2009 22:50:11 +0000 (22:50 +0000)
end-of-body treatment

lib/smtp.c

index 074d9e7db08c4a189995bca6edc13b35fc20a098..44e405ed5751cae0b2d81352b58ed2aa6fae35b8 100644 (file)
@@ -321,7 +321,7 @@ static CURLcode smtp_mail(struct connectdata *conn)
   struct SessionHandle *data = conn->data;
 
   /* send MAIL */
-  result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:<%s>",
+  result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:%s",
                          data->set.str[STRING_MAIL_FROM]);
   if(result)
     return result;
@@ -346,7 +346,7 @@ static CURLcode smtp_state_mail_resp(struct connectdata *conn,
   }
   else {
     /* send RCPT TO */
-    result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:<%s>",
+    result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:%s",
                            data->set.str[STRING_MAIL_RCPT]);
     if(result)
       return result;
@@ -392,15 +392,14 @@ static CURLcode smtp_state_data_resp(struct connectdata *conn,
 
   (void)instate; /* no use for this yet */
 
-  if(smtpcode/100 != 2) {
+  if(smtpcode != 354) {
     state(conn, SMTP_STOP);
     return CURLE_RECV_ERROR;
   }
 
   /* SMTP upload */
-  result=Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE,
-                             smtp->bytecountp,
-                             -1, NULL); /* no upload here */
+  result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
+                               FIRSTSOCKET, smtp->bytecountp);
 
   state(conn, SMTP_STOP);
   return result;