]> SAFE projects GIT repository - jmp/mailleur/commitdiff
feed00 and feed01 working fine
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 20 Jun 2025 05:28:34 +0000 (01:28 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 20 Jun 2025 05:28:34 +0000 (01:28 -0400)
app/feeder.c
data-feed/feed01.tst
lib/lvleml.c

index 625a6933552a54864510237b21ae3842b315fac8..20aa44f9bbc1d47771ec19a1c95a5e8009b4fb3c 100644 (file)
@@ -91,6 +91,23 @@ static void report(int numline,char *line,char *trouble)
 */
 /************************************************/
 /*                                             */
+/*     Send transmission out                   */
+/*                                             */
+/************************************************/
+static int sendout(SOCPTR *socptr,char *line)
+
+{
+int taille;
+
+taille=tcp_write(socptr,line);
+taille+=tcp_write(socptr,CRLF);
+return taille;
+}
+/*
+^L
+*/
+/************************************************/
+/*                                             */
 /*     procedure to set feed scan in comment   */
 /*      mode.                                   */
 /*                                             */
@@ -144,7 +161,7 @@ while (proceed==true) {
   //(void) rou_alert(0,"%s JMPDBG phase='%d'",OPEP,phase);
   switch (phase) {
     case 0      :       //Transmit "DATA" to remote
-      if (tcp_write(fd->socptr,action)!=(strlen(action)+2))
+      if (sendout(fd->socptr,action)!=(strlen(action)+2))
         phase=999;      //Unable to send STARTTLS sequence 
       break;
     case 1      :       //Get DATA command status
@@ -178,13 +195,13 @@ while (proceed==true) {
             if (data[2]=='.') {
               (void) memmove(data+3,data+2,strlen(data+2));
               }
-            (void) tcp_write(fd->socptr,data+2);
+            (void) sendout(fd->socptr,data+2);
             break;
           case 'C'      :       //data marker
             switch (data[2]) {
               case '.'  :       //end of data marker
                 if (numdata>1)  //could be empty data
-                  (void) tcp_write(fd->socptr,".");
+                  (void) sendout(fd->socptr,".");
                 completed=true;
                 break;
               case 'T'  :       //timer data
@@ -193,7 +210,7 @@ while (proceed==true) {
 
                 isnow=time((time_t *)0);
                 (void) snprintf(ed,sizeof(ed),"Date: %s",rou_ascsysstamp(isnow));
-                (void) tcp_write(fd->socptr,ed);
+                (void) sendout(fd->socptr,ed);
                 break;
               default   :       //unexpected data marker
                  (void) rou_alert(0,"%s Unexpected data marker <%s> (Bug?)",
@@ -232,6 +249,7 @@ return status;
 static _Bool gomodetls(SOCPTR *socptr)
 
 {
+#define OPEP    "feeder.c:gomodetls,"
 
 _Bool status;
 char *got;
@@ -245,9 +263,10 @@ action="starttls";
 phase=0;
 proceed=true;
 while (proceed==true) {
+  //(void) rou_alert(0,"%s JMPDBG phase='%d' status='%d'",OPEP,phase,status);
   switch (phase) {
     case 0      :       //Sending START TLS command
-      if (tcp_write(socptr,action)!=(strlen(action)+2))
+      if (sendout(socptr,action)!=(strlen(action)+2))
         phase=999;      //Unable to send STARTTLS sequence 
       break;
     case 1      :       //Get STARTTLS command status
@@ -279,6 +298,8 @@ while (proceed==true) {
   phase++;
   }
 return status;
+
+#undef  OPEP
 }
 /*
 ^L
@@ -550,8 +571,7 @@ while (proceed==true) {
           status=doincoming(fd->socptr,*numline,line);
           break;
         case 'S'        :       //sending data
-          (void) tcp_write(fd->socptr,line);
-          (void) tcp_write(fd->socptr,CRLF);
+          (void) sendout(fd->socptr,line);
           break;
         case 'T'        :       //Get the test titre
           status=strncpy(testname,line,sizeof(testname));
index 641be08b05604c727c830492b0dae1fcc10fa182..4e617f846d6ddab12ef3d412bf177b96fd65fcb3 100644 (file)
@@ -2,17 +2,28 @@
 T:(feed01) Sending a a simple mail to remote server
 R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
 #====================================================
-S:HELO example.com
+S:EHLO example.com
 #R:250-mailleur.example.com, link (cleartext) ready, your IP/FQDN=[127.127.0.2/feed2.example.com]
-R:250 mailleur.example.com, link (cleartext) ready,...
+R:250-mailleur.example.com, link (cleartext) ready,...
+R:250-SIZE 52428800
+R:250-STARTTLS
+R:250-8BITMIME
+R:250-ENHANCEDSTATUSCODES
+R:250 AUTH PLAIN LOGIN
 C:GOTLS
-R:250 Link now encryp...
+C:WAIT 1
+S:EHLO example.com
+R:250-mailleur.example.com, link (crypted) ready,...
+R:250-SIZE 52428800
+R:250-8BITMIME
+R:250-ENHANCEDSTATUSCODES
+R:250 AUTH PLAIN LOGIN
 S:MAIL FROM: <postmaster@example.com>
 R:250 2.1.3 postmaster@example.com.. sender ok
 S:RCPT TO: <dom1user1@mailref1.example.com>
-R:250 2.6.4 Address accepted
+R:250 2.6.4 Address accepted <dom1user1@mailref1.example.com>
 S:RCPT TO: <dom1user2@mailref1.example.com>
-R:250 2.6.4 Address accepted
+R:250 2.6.4 Address accepted <dom1user2@mailref1.example.com>
 #-------------------------------------------------------------------------
 #-sending data
 C:DATA 354 3.5.0 End data with <CR><LF>.<CR><LF>
@@ -34,6 +45,8 @@ D:end
 D:ligne court|
 C:.
 #-------------------------------------------------------------------------
-R:250 3.5.3 Message accepted for delivery (Session...
+R:250-3.5.3 Session ID=<...
+R:250-3.5.3 data stream received:...
+R:250 3.5.3 Message accepted for delivery
 S:QUIT
 R:221 2.0.0 Bye, closing connection...
index e15777460615357e78d6ffac638e77e604bb9026..5b0227c977cc36fdf096458ab2e82e486c049bb4 100644 (file)
@@ -138,7 +138,6 @@ if (rou_vasprintf(&line,fmt,args)>0) {
   contact->transout=tcp_addline(contact->transout,line); 
   }
 if (flush==true) {
-  (void) rou_alert(0,"JMPDBG trans=<%s>",contact->transout);
   (void) tcp_write(contact->socptr,contact->transout);
   contact->transout=rou_freestr(contact->transout);
   }
@@ -543,10 +542,12 @@ while (proceed==true) {
       total+=1023;
       total/=1024;    //KBytes
       delta=rou_getdifftime(&start);
-      fmt="%d 3.5.3 Message accepted for delivery (Session ID=<%s>)";
+      fmt="%d-3.5.3 Session ID=<%s>";
+      (void) transmit(contact,false,fmt,CMDOK,contact->cursesid);
+      fmt="%d-3.5.3 data stream received: %d Kbytes within %d.%03d seconds)";
+      (void) transmit(contact,false,fmt,CMDOK,total,delta/1000,delta%1000);
+      fmt="%d 3.5.3 Message accepted for delivery";
       (void) transmit(contact,true,fmt,CMDOK,contact->cursesid);
-      fmt="(DATA stream received: %d Kbytes within %d.%03d seconds)";
-      (void) log_fprintlog(contact->logptr,false,fmt,total,delta/1000,delta%1000);
       done=true;
       proceed=false;    //task done
       break;