From: Jean-Marc Pigeon Date: Mon, 17 Nov 2025 20:27:51 +0000 (-0500) Subject: Adding note_status to some lvleml message X-Git-Tag: tag-0.18~25 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=9949dd51fadf4519d2d7a062215afae9307525f7;p=jmp%2Fmailleur Adding note_status to some lvleml message --- diff --git a/lib/lvleml.c b/lib/lvleml.c index 0e41f2b..4b7ce5d 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -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; } }