]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Adding note_status to some lvleml message
authorJean-Marc Pigeon <jmp@safe.c>
Mon, 17 Nov 2025 20:27:51 +0000 (15:27 -0500)
committerJean-Marc Pigeon <jmp@safe.c>
Mon, 17 Nov 2025 20:27:51 +0000 (15:27 -0500)
lib/lvleml.c

index 0e41f2b2c1c507e6473621e80d209031b8eb5023..4b7ce5d8eca02cd10f8df276d0974b9db948707d 100644 (file)
@@ -400,8 +400,8 @@ while (proceed==true) {
     case 1      :       //checking credential
       if (srv->links>1) {
         status=ALREADY;
-        (void) note_status(contact,status,"---",
-                                   "%d-4.5.6 Server already connected",status);
+        (void) note_status(contact,status,NULL,"%d-4.5.6 Server already connected",
+                                                status);
         phase=999;      //To many server connected
         }
       break;
@@ -419,7 +419,7 @@ while (proceed==true) {
                                                     contact->peerip,
                                                     srv->credit,"too low");
         status=BLCKLST;
-        (void) note_status(contact,status,"---",ninfo,status,contact->peerip,cmt);
+        (void) note_status(contact,status,NULL,ninfo,status,contact->peerip,cmt);
         (void) setterminator(contact,"Remote server credit is too low");
         phase=999;      //To many server connected
         }
@@ -634,8 +634,10 @@ for (int i=0;i<2;i++) {
    (void) eml_transmit(contact,true,"%d %s",SENDB64,logdat[i]);
    got=tcp_getline(contact->socptr,contact->delay,&line);
    if (got<=0) {
+     const char *ninfo="%d 5.7.2 auth sequence missing";
+
      (void) strcpy(local,"");
-     (void) eml_transmit(contact,true,"%d 5.7.2 auth sequence missing",UKNUSER);
+     (void) note_status(contact,UKNUSER,NULL,ninfo,UKNUSER);
      break;                 //exiting from loop
      }
   (void) log_fprintlog(contact->logptr,false,"%s",line);
@@ -838,7 +840,7 @@ while (proceed==true) {
     case 0      :               //are we encrypted and on the right port
       if (soc_iscrypted(contact->socptr)==false) {
         static char *cmt="no authentication allowed on clear chanel";
-        (void) note_status(contact,FAILED,"---","%d 5.7.0 %s",FAILED,cmt);
+        (void) note_status(contact,FAILED,NULL,"%d 5.7.0 %s",FAILED,cmt);
         (void) setterminator(contact,cmt);
         contact->credit-=1;     //"Bad boy"
         phase=999;              //No need to go further 
@@ -846,7 +848,9 @@ while (proceed==true) {
       break;
     case 1      :       //check buffer
       if ((buffer==(char *)0)||(strlen(buffer)==0)) {
-        (void) eml_transmit(contact,true,"%d 5.7.1 Missing auth type",FAILED);
+        const char *ninfo="%d 5.7.1 Missing auth type";
+
+        (void) note_status(contact,UKNUSER,NULL,ninfo,FAILED);
         phase=999;      //No need to go further 
         }
       break;
@@ -867,8 +871,8 @@ while (proceed==true) {
         static char *cmt="bad authentication type";
 
         (void) rou_alert(0,"%s auth type <%s> unknown (Bug?)",OPEP,local);
+        (void) note_status(contact,BADPAR,NULL,"%d 5.7.2 %s",BADPAR,cmt);
         (void) setterminator(contact,cmt);
-        (void) eml_transmit(contact,true,"%d 5.7.2 %s",BADPAR,cmt);
         phase=999;      //Trouble Trouble
         }
       break;
@@ -909,12 +913,14 @@ while (proceed==true) {
         fmt=DISP"Auth Rejected status='%d' for user=<%s> pass=<%s>";
         (void) log_fprintlog(contact->logptr,true,fmt,BADAUTH,auth,rmtpass);
         (void) sleep(2);
-        (void) eml_transmit(contact,true,"%d 5.7.4 authentication failed",BADAUTH);
+        (void) note_status(contact,BADAUTH,NULL,"%d 5.7.4 wrong authentication",
+                                                 BADAUTH);
         contact->credit-=1;
         }
       else {
         (void) log_fprintlog(contact->logptr,true,fmt,auth);
-        (void) eml_transmit(contact,true,"%d 5.7.5 Authentication successful",IDOK);
+        (void) note_status(contact,IDOK,NULL,"%d 5.7.5 authentication successful",
+                                              IDOK);
         contact->credit+=2;
         }
       }