]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Improving authentication sequence
authorJean-Marc Pigeon <jmp@safe.c>
Thu, 27 Nov 2025 20:04:24 +0000 (15:04 -0500)
committerJean-Marc Pigeon <jmp@safe.c>
Thu, 27 Nov 2025 20:04:24 +0000 (15:04 -0500)
lib/lvleml.c
lib/unieml.h

index a83073d1b6c7ac60cd31315809b0b4bfbc302958..2c9fbc1ef1d5b1b1a9e0f9646dc348aa01da2783 100644 (file)
@@ -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);
index 45623e99abbd61d3c819f3e65f11e1cbc707c113..428d8cda74ed79c0307807eaf926f43354967f4a 100644 (file)
@@ -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