]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Adding "noop" smtp command
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 5 May 2025 19:06:08 +0000 (15:06 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 5 May 2025 19:06:08 +0000 (15:06 -0400)
lib/lvleml.c
lib/unieml.c
lib/unieml.h
lib/unitls.c

index 0752e443adada13ef9aec53daa4e3c9fd46836d4..72b6f07a268c06c0234ea283bd7d46283b34a0c0 100644 (file)
@@ -403,6 +403,10 @@ while (proceed==true) {
     case c_ehlo         :       //EHLO SMTP protocol
       proceed=doehlo(contact,line);
       break;
+    case c_noop         :       //No Operation
+      (void) transmit(contact,"%d 2.0.0 OK, %s",    
+                              CMDOK,contact->mainsesid);
+      break;
     case c_quit         :       //QUIT SMTP protocol
       (void) transmit(contact,"%d 2.0.0 Bye, closing connection %s",    
                               QUITOK,contact->mainsesid);
@@ -430,17 +434,19 @@ while (proceed==true) {
           break;
         }
       break;
-    case c_unknown      :       //uknown keyword
-      (void) rou_alert(0,"Command <%s> from [%s] is unknown (config?)",
+    case c_unknown      :       //unknown keyword
+      (void) rou_alert(0,"SMTP Command <%s> from [%s] is unknown (config?)",
                          line,contact->peerip);
-      (void) transmit(contact,"%d-5.5.1 command <%s> is unknown",CMDBAD,line);
-      (void) transmit(contact,"%d 2.0.0 Bye, closing connection %s",    
-                              QUITOK,contact->mainsesid);
-      status=-1;                 //remote is a trouble maker
-      proceed=false;
+      (void) transmit(contact,"%d-5.5.1 Unrecognized command, see RFC 5321",CMDBAD);
+      (void) transmit(contact,"%d-5.5.1 https://www.rfc-editor.org",CMDBAD);
+      (void) transmit(contact,"%d 5.5.1 session %s is still running",
+                              CMDBAD,contact->mainsesid);
       break;
     default             : 
       (void) rou_alert(0,"Unable to find keyword for <%s> (Bug?)",OPEP,line);
+      (void) transmit(contact,"%d 2.0.0 Bye, closing connection %s",    
+                              QUITOK,contact->mainsesid);
+      status=-1;                 //remote is a trouble maker
       status=-3;
       proceed=false;
       break;
index 1a3fa0e57d475ecd21e2b371b261f80dfcd60240..148d779c99e4e294a5a009c5e7f6363fcbccf658 100644 (file)
@@ -22,6 +22,7 @@ typedef struct  {
 static VOCTYP vocsmtp[]={
                 {c_helo,"HELO"},
                 {c_ehlo,"EHLO"},
+                {c_noop,"NOOP"},
                 {c_quit,"QUIT"},
                 {c_rset,"RSET"},
                 {c_mail,MAILF},
index be4e9a66b29167898fba9ea850febd1ec4fd6b19..17f56e57d2d99448600e9f6716257cf309f6474d 100644 (file)
@@ -25,6 +25,7 @@
 typedef enum    {               //list of SMTP protocol keyword
                 c_helo,         //Basic Helo command
                 c_ehlo,         //EHLO command
+                c_noop,         //No Operation request
                 c_quit,         //quit exchange
                 c_rset,         //resetting session
                 c_mail,         //mail from sequence detected
index 1f57e6801a1ba55e1d1921b271824344ff3691c8..d7defb794ce241ec8ac14a4824541fb569c27b1b 100644 (file)
@@ -389,10 +389,10 @@ while (proceed==true) {
       char *line;
 
       line=X509_NAME_oneline(X509_get_subject_name(peer),0,0);
-      (void) rou_alert(2,"Certificate subject=<%s>",line);
+      (void) rou_alert(4,"Certificate subject=<%s>",line);
       line=rou_freestr(line);
       line=X509_NAME_oneline(X509_get_issuer_name(peer),0,0);
-      (void) rou_alert(2,"Certificate issuer=<%s>",line);
+      (void) rou_alert(4,"Certificate issuer=<%s>",line);
       line=rou_freestr(line);
       }
       break;