]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Trying to change mailleur.conf SMTPPORTS format
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sun, 22 Jun 2025 11:46:43 +0000 (07:46 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sun, 22 Jun 2025 11:46:43 +0000 (07:46 -0400)
Makefile.dbg
conf/mailleur.conf
conf/mailleur.conf.dvl
lib/devsoc.c
lib/lvleml.c
lib/modrec.c
lib/subafn.c

index 98ab507c4d83cb1e15260b61570d0d890488f488..b27fc4d452d5521369355c2f02afa48a67902ba6 100644 (file)
@@ -18,7 +18,7 @@ EMLPAR        =                                               \
           -r $(TESTDIR)                                \
           -c ./conf/$(APPNAME).conf.dvl                \
           -d 2                                         \
-          $(TESTPROT):$(TESTIP):$(TESTPORT):
+          $(TESTPROT)|$(TESTIP)|$(TESTPORT)|
 
 #====================================================================
 #area to start components receiver,sorter,sender once at a time
index 6e212096570b15782535ee6cddc43c5b09a4197c..d11aa2a73658d9143b5f2c959a8206a92c367d1b 100644 (file)
@@ -7,18 +7,18 @@ DFLTDOMAIN="localdomain"
 #------------------------------------------------
 #list of listening port to do SMTP protocole
 #format
-#protocol:ipnum:port:iteration[,protocol:ipnum:port:iteration]++
+#protocol|ipnum|port|iteration[,protocol|ipnum|port|iteration]++
 #example
-#stmtps:ipnum:465:5    -> protocol smtps:IP number:port 465:5 iterations
-#:ipnum:::             -> smtp:ipnum:25:2
-#::,smtps::465:2       -> smtp:0.0.0.0:25:2 + smtps::465:2
-#::                    -> smtp:0.0.0.0:25:2
+#stmtps|ipnum|465|5    -> protocol smtps|IP number|port 465|5 iterations
+#|ipnum|||             -> smtp|ipnum|25|2
+#||,smtps||465|2       -> smtp|0.0.0.0|25|2 + smtps||465|2
+#||                    -> smtp|0.0.0.0|25|2
 #Examples
-#SMTPPORTS=":127.127.10.25:1025:,smtps:127.127.10.25:1026:1"
-#SMTPPORTS=":127.127.10.25:1025:"
-#SMTPPORTS="smtps:127.127.10.25:1065:1"
+#SMTPPORTS="|127.127.10.25|1025|,smtps|127.127.10.25|1026|1"
+#SMTPPORTS="|127.127.10.25|1025|"
+#SMTPPORTS="smtps|127.127.10.25|1065|1"
 #Defaults
-SMTPPORTS=":::5,smtps::465:3,smtp::587:2"
+SMTPPORTS="|||5,smtps||465|3,smtp||587|2"
 #------------------------------------------------
 #Defining SERVER mode Certificate data
 CA_ROOT_SRV="/etc/pki/mailleur/root-safe_CA.pem"
index d5d7b7dab4d9cbedd26f4160d5517c7a87956e93..5811162d5e7674ab6f88c6c1bc3760f7b8ae8364 100644 (file)
@@ -8,16 +8,16 @@ DFLTDOMAIN="example.com""
 #------------------------------------------------
 #list of listening port to do SMTP protocole
 #format
-#protocol:ipnum:port:iteration[,protocol:ipnum:port:iteration]++
+#protocol|ipnum|port|iteration[,protocol|ipnum|port|iteration]++
 #example
-#stmtps:ipnum:465:5    -> protocol smtps:IP number:port 465:5 iterations
-#:ipnum:::             -> smtp:ipnum:25:2
-#::,smtps::465:2       -> smtp:0.0.0.0:25:2 + smtps::465:2
-#::                    -> smtp:0.0.0.0:25:2
-#SMTPPORTS="::1025"
-#SMTPPORTS=":127.127.10.25:1025:,smtps:127.127.10.25:1026:1"
-#SMTPPORTS=":127.127.10.25:1025:"
-#SMTPPORTS="smtps:127.127.10.25:1065:1"
+#stmtps|ipnum|465|5    -> protocol smtps|IP number|port 465|5 iterations
+#|ipnum|||             -> smtp|ipnum|25|2
+#||,smtps||465|2       -> smtp|0.0.0.0|25|2 + smtps||465|2
+#||                    -> smtp|0.0.0.0|25|2
+#SMTPPORTS="||1025"
+#SMTPPORTS="|127.127.10.25|1025|,smtps|127.127.10.25|1026|1"
+#SMTPPORTS="|127.127.10.25|1025|"
+#SMTPPORTS="smtps|127.127.10.25|1065|1"
 #------------------------------------------------
 #Defining SERVER mode Certificate data
 CA_ROOT_SRV="./certs/root-safe_CA.pem"
index 77f0cfe0cf2243b5e7d24ee730f3dae64a1c0527..379511ba2d87fa6db47b2388670d096ee1ad329f 100644 (file)
@@ -1414,7 +1414,7 @@ if (soc!=(SOCTYP *)0) {
         case false      :
           char local[NI_MAXHOST+NI_MAXSERV+1];
 
-          (void) snprintf(local,sizeof(local),"%s:%s",host,serv);
+          (void) snprintf(local,sizeof(local),"%s|%s",host,serv);
           data=strdup(local);
           break;
         }
index fff958346329a4c5fc4b1798d6a0d580fd7c4d8a..b9e7c32d41c7e933e160d909d8dffa7001a9acd3 100644 (file)
@@ -1606,7 +1606,7 @@ while (proceed==true) {
         char *ptr;
         
         //extracting service port number
-        if ((ptr=strrchr(contact->locip,':'))!=(char *)0) {
+        if ((ptr=strrchr(contact->locip,'|'))!=(char *)0) {
           *ptr='\000';
           contact->locserv=strdup(ptr+1);
           }
index e32667238d45e8efcbff1d8ef96f0373707d7f74..03a789dc8ceba296b9552224ce6af5670d2f7409 100644 (file)
@@ -61,11 +61,11 @@ for (int i=0;i<argc;i++) {
   proto=pro_smtp; 
   ipnum=DIP;
   port=DPORT;
-  //(void) rou_alert(0,"%s JMPDBG argv[%d]=<%s>",OPEP,i,argv[i]);
+  (void) rou_alert(0,"%s JMPDBG argv[%d]=<%s>",OPEP,i,argv[i]);
   for (int j=0;j<3;j++) {
     char *sofar;
 
-    if ((sofar=strchr(ptr,':'))==(char *)0) 
+    if ((sofar=strchr(ptr,'|'))==(char *)0) 
       break;
     *sofar='\000';
     sofar++;
@@ -319,6 +319,7 @@ PUBLIC void rec_handlesmtp(int argc,char *argv[])
 {
 #define OPEP    "modrec.c:rec_handlesmtp"
 #define RELAX   5       //Relax time between process checking
+#define DFLTSET "smtp|0.0.0.0|25|2"
 
 pid_t *childs;
 char *locargv[2];
@@ -332,7 +333,7 @@ childs=(pid_t)0;
 (void) memset(locargv,'\000',sizeof(locargv));
 locargv[0]=getenv("SMTPPORTS");
 if (locargv[0]==(char *)0) 
-  locargv[0]="smtp:0.0.0.0:25:2"; //default configuration
+  locargv[0]=DFLTSET; //default configuration
 if (argc==0) {
    argc=1;
    argv=locargv;
@@ -418,6 +419,7 @@ while (proceed==true) {
   phase++;
   }
 
+#undef  DFLTSET
 #undef  RELAX
 #undef  OPEP
 }
index 9e1fefd69db71ad468593a108b3749feb4185982..1d0c4509db3a54c7cc870cc606ad812e67eeb5b2 100644 (file)
@@ -160,12 +160,14 @@ afnnum=(AFNTYP *)0;
 phase=0;
 proceed=true;
 while (proceed==true) {
+  (void) fprintf(stderr,"%s JMPDBG phase='%d', onecleanipstr=<%s>",
+                         OPEP,phase,onecleanipstr);
   switch (phase) {
     case 0     :       /*lets say ip format ok */
       afnnum=(AFNTYP *)calloc(1,sizeof(AFNTYP));
       afnnum->afntype=AF_INET;
       afnnum->afnmask=32;
-      if (strchr(onecleanipstr,':')==(char *)0) 
+      if (strchr(onecleanipstr,'|')==(char *)0) 
        phase++;        //This is an IPV4 number
       break;
     case 1     :       //IP is an IPV6 format