From c0403bc1598b6a946f2be7c9ac2bbb4c2fa26111 Mon Sep 17 00:00:00 2001 From: Jean-Marc Pigeon Date: Thu, 27 Nov 2025 15:04:24 -0500 Subject: [PATCH] Improving authentication sequence --- lib/lvleml.c | 15 +++++++++------ lib/unieml.h | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/lvleml.c b/lib/lvleml.c index a83073d..2c9fbc1 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -800,7 +800,7 @@ while (proceed==true) { if ((buffer==(char *)0)||(strlen(buffer)==0)) { const char *ninfo="%d 5.7.1 Missing auth type"; - (void) eml_note(contact,NULL,ninfo,UKNUSER); + (void) eml_note(contact,NULL,ninfo,DISCARD); (void) eml_transmit(contact,true,ninfo,UKNUSER); phase=999; //No need to go further } @@ -822,7 +822,7 @@ while (proceed==true) { static char *cmt="bad authentication type"; (void) rou_alert(0,"%s auth type <%s> unknown (Bug?)",OPEP,local); - (void) eml_note(contact,NULL,"%d 5.7.2 %s",BADPAR,cmt); + (void) eml_note(contact,NULL,"%d %s",DISCARD,cmt); (void) eml_transmit(contact,true,"%d 5.7.2 %s",BADPAR,cmt); (void) setterminator(contact,cmt); phase=999; //Trouble Trouble @@ -837,9 +837,10 @@ while (proceed==true) { static char *cmt="Unsafe PLAIN auth mode"; contact->credit-=2; - (void) eml_note(contact,NULL,"%d 5.7.3 %s",FAILED,cmt); + (void) eml_note(contact,NULL,"%d %s",DISCARD,cmt); (void) eml_transmit(contact,true,"%d 5.7.3 %s",FAILED,cmt); (void) setterminator(contact,cmt); + phase=999; } break; case 1 : //AUTH LOGIN @@ -849,9 +850,10 @@ while (proceed==true) { static char *cmt="Unsafe LOGIN auth mode"; contact->credit-=2; - (void) eml_note(contact,NULL,"%d 5.7.3 %s",FAILED,cmt); + (void) eml_note(contact,NULL,"%d %s",DISCARD,cmt); (void) eml_transmit(contact,true,"%d 5.7.3 %s",FAILED,cmt); (void) setterminator(contact,cmt); + phase=999; } break; case 2 : //AUTH DIGEST-MD5 @@ -880,11 +882,12 @@ 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_note(contact,NULL,"000 user <%s> pass=<%s> bad authentication", - auth,rmtpass); + (void) eml_note(contact,NULL,"%d user <%s> pass=<%s> bad authentication", + DISCARD,auth,rmtpass); (void) eml_transmit(contact,true,"%d 5.7.4 wrong authentication",BADAUTH); (void) setterminator(contact,"Authentication failure"); contact->credit-=1; + phase=999; } else { (void) log_fprintlog(contact->logptr,true,fmt,auth); diff --git a/lib/unieml.h b/lib/unieml.h index 45623e9..428d8cd 100644 --- a/lib/unieml.h +++ b/lib/unieml.h @@ -43,6 +43,7 @@ #define NORELAY 555 //we do not relay email #define BLCKLST 556 //remote site Black listed #define MISSMX 563 //NO MX found for recipient +#define DISCARD 999 //Internal code to post comment via note //defining extensions #define EXTODO "todo" //todo qfile extension -- 2.47.3