Made Cc: actually work.
diff --git a/contiki/apps/smtp-socket.c b/contiki/apps/smtp-socket.c
index 2ac6c7e..09d9b1d 100644
--- a/contiki/apps/smtp-socket.c
+++ b/contiki/apps/smtp-socket.c
@@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
- * $Id: smtp-socket.c,v 1.5 2005/05/05 22:15:19 oliverschmidt Exp $
+ * $Id: smtp-socket.c,v 1.6 2005/05/05 23:02:01 oliverschmidt Exp $
*/
#include "smtp.h"
@@ -124,13 +124,27 @@
PSOCK_EXIT(&s.psock);
}
+ if(*s.cc != 0) {
+ SEND_STRING(&s.psock, (char *)smtp_rcpt_to);
+ SEND_STRING(&s.psock, s.cc);
+ SEND_STRING(&s.psock, (char *)smtp_crnl);
+
+ PSOCK_READTO(&s.psock, ISO_nl);
+
+ if(s.inputbuffer[0] != ISO_2) {
+ PSOCK_CLOSE(&s.psock);
+ smtp_done(6);
+ PSOCK_EXIT(&s.psock);
+ }
+ }
+
SEND_STRING(&s.psock, (char *)smtp_data);
PSOCK_READTO(&s.psock, ISO_nl);
if(s.inputbuffer[0] != ISO_3) {
PSOCK_CLOSE(&s.psock);
- smtp_done(6);
+ smtp_done(7);
PSOCK_EXIT(&s.psock);
}
@@ -138,9 +152,11 @@
SEND_STRING(&s.psock, s.to);
SEND_STRING(&s.psock, (char *)smtp_crnl);
- SEND_STRING(&s.psock, (char *)smtp_cc);
- SEND_STRING(&s.psock, s.cc);
- SEND_STRING(&s.psock, (char *)smtp_crnl);
+ if(*s.cc != 0) {
+ SEND_STRING(&s.psock, (char *)smtp_cc);
+ SEND_STRING(&s.psock, s.cc);
+ SEND_STRING(&s.psock, (char *)smtp_crnl);
+ }
SEND_STRING(&s.psock, (char *)smtp_from);
SEND_STRING(&s.psock, s.from);
@@ -160,7 +176,7 @@
PSOCK_READTO(&s.psock, ISO_nl);
if(s.inputbuffer[0] != ISO_2) {
PSOCK_CLOSE(&s.psock);
- smtp_done(7);
+ smtp_done(8);
PSOCK_EXIT(&s.psock);
}
diff --git a/contiki/apps/smtp-strings b/contiki/apps/smtp-strings
index c1bec90..359ceef 100644
--- a/contiki/apps/smtp-strings
+++ b/contiki/apps/smtp-strings
@@ -4,7 +4,7 @@
smtp_rcpt_to "RCPT TO: "
smtp_data "DATA\r\n"
smtp_to "To: "
-smtp_to "cc: "
+smtp_to "Cc: "
smtp_from "From: "
smtp_subject "Subject: "
smtp_quit "QUIT\r\n"
diff --git a/contiki/apps/smtp-strings.c b/contiki/apps/smtp-strings.c
index 57fff70..4076424 100644
--- a/contiki/apps/smtp-strings.c
+++ b/contiki/apps/smtp-strings.c
@@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
- * $Id: smtp-strings.c,v 1.5 2005/04/28 22:36:07 oliverschmidt Exp $
+ * $Id: smtp-strings.c,v 1.6 2005/05/05 23:02:02 oliverschmidt Exp $
*/
const char smtp_220[4] =
/* "220" */
@@ -51,8 +51,8 @@
/* "To: " */
{0x54, 0x6f, 0x3a, 0x20, };
const char smtp_cc[5] =
-/* "cc: " */
-{0x63, 0x63, 0x3a, 0x20, };
+/* "Cc: " */
+{0x43, 0x63, 0x3a, 0x20, };
const char smtp_from[7] =
/* "From: " */
{0x46, 0x72, 0x6f, 0x6d, 0x3a, 0x20, };