]> code.citadel.org Git - citadel.git/commitdiff
* SMTP hacks to deal with AOL braindamage
authorArt Cancro <ajc@citadel.org>
Sun, 19 Mar 2000 05:02:40 +0000 (05:02 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 19 Mar 2000 05:02:40 +0000 (05:02 +0000)
citadel/ChangeLog
citadel/clientsocket.c
citadel/clientsocket.h
citadel/network/mail.sysinfo
citadel/serv_smtp.c

index b4d4a9d3028922a51b1fcea7dc500b40a5c0548b..146cba17141a82765f9362d80b06a1268e34425b 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 1.493  2000/03/19 05:02:39  ajc
+ * SMTP hacks to deal with AOL braindamage
+
  Revision 1.492  2000/03/18 18:18:04  ajc
  * Support multiline responses from SMTP servers when sending mail
 
@@ -1759,4 +1762,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
-
index f645e9261cd231e205ab6f8ab7449cccb2251063..a7a7e82c23445b7edff09c4428f8ad0d6294b66a 100644 (file)
@@ -169,8 +169,8 @@ int ml_sock_gets(int sock, char *buf) {
        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);
@@ -195,3 +195,19 @@ int sock_puts(int sock, char *buf)
        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);
+}
index 6bbe88db57eadd2aefe7908bea23004e874d2cf5..cdcae4489a72c748826243b9aac34ecef376096e 100644 (file)
@@ -10,6 +10,7 @@ int sock_write(int sock, char *buf, int nbytes);
 int ml_sock_gets(int sock, char *buf);
 int sock_gets(int sock, char *buf);
 int sock_puts(int sock, char *buf);
+int sock_puts_crlf(int sock, char *buf);
 
 /* 
  * This looks dumb, but it's being done for future portability
index c18500367352beb0dbc5e9ebbefc127d35289eb0..5437c78ae5c8551f945eca251f18a46ea072f359 100644 (file)
@@ -3,7 +3,7 @@ use uncnsrd
 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
@@ -15,13 +15,13 @@ lastcontact 953246224 Thu Mar 16 17:37:04 2000
 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
@@ -36,7 +36,7 @@ tesseract
 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
@@ -99,7 +99,7 @@ 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
@@ -113,7 +113,7 @@ 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
index 83a7d02b417a355d670ae39d59266f317ec82627..81d90956d56d6431342750c98491cb7cbc6a7626 100644 (file)
@@ -885,7 +885,7 @@ void smtp_try(char *key, char *addr, int *status, char *dsn, long msgnum)
        /* 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");
@@ -907,9 +907,9 @@ void smtp_try(char *key, char *addr, int *status, char *dsn, long msgnum)
 
 
        /* 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");
@@ -931,9 +931,9 @@ void smtp_try(char *key, char *addr, int *status, char *dsn, long msgnum)
 
 
        /* 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");
@@ -956,7 +956,7 @@ void smtp_try(char *key, char *addr, int *status, char *dsn, long msgnum)
 
        /* 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");
@@ -1016,7 +1016,7 @@ void smtp_try(char *key, char *addr, int *status, char *dsn, long msgnum)
        *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);