int g;
g = sock_gets(sock, buf);
- if (g < 0) return(g);
- if ( (g < 4) || (buf[3] != '-')) return(g);
+ if (g < 4) return(g);
+ if (buf[3] != '-') return(g);
do {
g = sock_gets(sock, bigbuf);
if (j<0) return(j);
return(i+j);
}
+
+
+/*
+ * sock_puts_crlf() - same as sock_puts() but ends line with CRLF, not LF
+ * Returns the number of bytes written, or -1 for error.
+ */
+int sock_puts_crlf(int sock, char *buf)
+{
+ int i, j;
+
+ i = sock_write(sock, buf, strlen(buf));
+ if (i<0) return(i);
+ j = sock_write(sock, "\r\n", 2);
+ if (j<0) return(j);
+ return(i+j);
+}
phonenum US 612 470 9635
gdom MN
humannode C-86 Test System
-lastcontact 953174223 Wed Mar 15 21:37:03 2000
+lastcontact 953365023 Sat Mar 18 02:37:03 2000
bccs
use uncnsrd
internet
uum %s
humannode Internet Gateway
-lastcontact 953307423 Fri Mar 17 10:37:03 2000
+lastcontact 953440623 Sat Mar 18 23:37:03 2000
uncnsrd
bin Mail
phonenum US 914 244 3252
humannode Uncensored
-lastcontact 953282223 Fri Mar 17 03:37:03 2000
+lastcontact 953343423 Fri Mar 17 20:37:03 2000
test
bin Mail
bin Mail
phonenum US 800 555 1212
humannode Tesseract Project
-lastcontact 953307423 Fri Mar 17 10:37:03 2000
+lastcontact 953440623 Sat Mar 18 23:37:03 2000
pixel
use uncnsrd
phonenum CA (604) 589-8539
gdom BC
humannode Feathers & Furballs
-lastcontact 952925823 Mon Mar 13 00:37:03 2000
+lastcontact 953325424 Fri Mar 17 15:37:04 2000
sbn
use uncnsrd
phonenum netproc[4026]: Adding non-neighbor system <sbn> to map
gdom or system <sbn> to map
humannode Dog Pound BBS II
-lastcontact 953217423 Thu Mar 16 09:37:03 2000
+lastcontact 953339823 Fri Mar 17 19:37:03 2000
jacs
use uncnsrd
/* Do a HELO command */
snprintf(buf, sizeof buf, "HELO %s", config.c_fqdn);
lprintf(9, ">%s\n", buf);
- sock_puts(sock, buf);
+ sock_puts_crlf(sock, buf);
if (ml_sock_gets(sock, buf) < 0) {
*status = 4;
strcpy(dsn, "Connection broken during SMTP conversation");
/* HELO succeeded, now try the MAIL From: command */
- snprintf(buf, sizeof buf, "MAIL From: %s", mailfrom);
+ snprintf(buf, sizeof buf, "MAIL From: <%s>", mailfrom);
lprintf(9, ">%s\n", buf);
- sock_puts(sock, buf);
+ sock_puts_crlf(sock, buf);
if (ml_sock_gets(sock, buf) < 0) {
*status = 4;
strcpy(dsn, "Connection broken during SMTP conversation");
/* MAIL succeeded, now try the RCPT To: command */
- snprintf(buf, sizeof buf, "RCPT To: %s", addr);
+ snprintf(buf, sizeof buf, "RCPT To: <%s>", addr);
lprintf(9, ">%s\n", buf);
- sock_puts(sock, buf);
+ sock_puts_crlf(sock, buf);
if (ml_sock_gets(sock, buf) < 0) {
*status = 4;
strcpy(dsn, "Connection broken during SMTP conversation");
/* RCPT succeeded, now try the DATA command */
lprintf(9, ">DATA\n");
- sock_puts(sock, "DATA");
+ sock_puts_crlf(sock, "DATA");
if (ml_sock_gets(sock, buf) < 0) {
*status = 4;
strcpy(dsn, "Connection broken during SMTP conversation");
*status = 2;
lprintf(9, ">QUIT\n");
- sock_puts(sock, "QUIT");
+ sock_puts_crlf(sock, "QUIT");
ml_sock_gets(sock, buf);
lprintf(9, "<%s\n", buf);