]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Able to transmit to mailref1
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 20 Jun 2025 21:25:25 +0000 (17:25 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 20 Jun 2025 21:25:25 +0000 (17:25 -0400)
app/feeder.c
lib/gestcp.c
lib/gestcp.h
lib/lvleml.c

index 6293e10a65baa7192ec1eebfe6ef6a8af8a2dd87..4b19c4a2c4ae4671b932c36c5abebfc609ff86e3 100644 (file)
@@ -99,8 +99,8 @@ static int sendout(SOCPTR *socptr,char *line)
 {
 int taille;
 
-taille=tcp_write(socptr,line);
-taille+=tcp_write(socptr,CRLF);
+taille=tcp_Swrite(socptr,line);
+taille+=tcp_Swrite(socptr,CRLF);
 return taille;
 }
 /*
index 5359c180abdfa0fb73b27920ec783568f347af86..79d540cb08fc6297df7c460ff92e26d2af843e4d 100644 (file)
@@ -122,7 +122,7 @@ return got;
 /*      return the number of char sent on channel.      */
 /*                                                      */
 /********************************************************/
-PUBLIC int tcp_write(SOCPTR *socptr,char *buffer)
+PUBLIC int tcp_Swrite(SOCPTR *socptr,char *buffer)
 
 {
 int sent;
@@ -134,6 +134,7 @@ if (socptr!=(SOCPTR *)0) {
   taille=strlen(buffer);
   if (taille>0) 
     sent=soc_writebuffer(socptr,buffer,taille);
+  (void) rou_alert(0,"JMPDBG Swrite=<%s>",buffer);
   }
 return sent;
 }
@@ -209,7 +210,7 @@ va_start(args,fmt);
 va_end(args);
 (void) log_fprintlog(rmt->logptr,false,strloc);
 (void) strcat(strloc,CRLF);
-(void) tcp_write(rmt->socptr,strloc);
+(void) tcp_Swrite(rmt->socptr,strloc);
 return tcp_get_smtp_reply(rmt,WAITRMT,resp);
 }
 /*
@@ -251,29 +252,30 @@ while (proceed==true) {
       char data[300];
 
       sent=0;
-      while (fgets(data,sizeof(data),qfile)!=(char *)0) {
-        do {    //cleaning line
+      while (fgets(data,sizeof(data)-4,qfile)!=(char *)0) {
+        do {
           register int taille;
           register char *ptr;
 
           taille=strlen(data)-1;
           if (taille<0)
             break;
-          ptr=data+taille;
+          ptr=data+taille; 
           if ((*ptr!='\n')&&(*ptr!='\r'))
-            break;
+            break;      //Line too long!
           *ptr='\000';
           }
         while (strlen(data)>0);
-        if ((strlen(data)>0)&&(data[0]=='.')) //dot escape
-          (void) memmove(data+1,data,strlen(data));
-        (void) rou_alert(0,"%s sending<
-        sent+=tcp_write(rmt->socptr,data);
+        //dot escape
+        if ((strlen(data)>0)&&(data[0]=='.'))
+          (void) memmove(data,data+1,strlen(data+1));
+        (void) strcat(data,CRLF);
+        sent+=tcp_Swrite(rmt->socptr,data);
         }
       break;
       }
     case 2      :       //end of transmission
-      sent+=tcp_write(rmt->socptr,ENDDATA);
+      sent+=tcp_Swrite(rmt->socptr,ENDDATA);
       break;
     case 3      :       //closing datafile
       qfile=eml_closeqfile(qfile);
index 734a60cff76f0eed84910898e5de671bc7aa6174..dc8b78de2fef2822b5bca20d7987011b30f3c86b 100644 (file)
@@ -31,7 +31,7 @@ PUBLIC char *tcp_addline(char *buffer,char *line);
 extern int tcp_getline(SOCPTR *socptr,u_int secwait,char **lineptr);
 
 //Transmit formated data to the contact channel
-extern int tcp_write(SOCPTR *socptr,char *buffer);
+extern int tcp_Swrite(SOCPTR *socptr,char *buffer);
 
 //wait and answer from remote and return the reply code
 extern  int tcp_get_smtp_reply(RMTTYP *rmt,int wait,char ***resp);
index c513945af4ab9047be35def1bdd342993ba9923c..40e13809ff973f3617b1826dfc4db805904de8f4 100644 (file)
@@ -138,7 +138,7 @@ if (rou_vasprintf(&line,fmt,args)>0) {
   contact->transout=tcp_addline(contact->transout,line); 
   }
 if (flush==true) {
-  (void) tcp_write(contact->socptr,contact->transout);
+  (void) tcp_Swrite(contact->socptr,contact->transout);
   contact->transout=rou_freestr(contact->transout);
   }
 line=rou_freestr(line);
@@ -1172,7 +1172,7 @@ while (proceed==true) {
         phase=999;      //No need to wait form response code
       break;
     case 2      :       //send the text termination
-      rspcode= tcp_get_smtp_reply(rmt,WAITRMT,&resp);
+      rspcode=tcp_get_smtp_reply(rmt,WAITRMT,&resp);
       break;
     case 3      :       //sending session data
       const char *fmt;