]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Backtracing the multiple afn implementation
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sat, 21 Jun 2025 14:18:29 +0000 (10:18 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sat, 21 Jun 2025 14:18:29 +0000 (10:18 -0400)
conf/mailleur.conf
conf/mailleur.conf.dvl
lib/Makefile
lib/unitls.c
shell/test-spf.sh

index 027555b69e3cd1c67ab663d78f16f03a3271748c..6e212096570b15782535ee6cddc43c5b09a4197c 100644 (file)
@@ -1,5 +1,10 @@
 #file used to set environment configuration
 #------------------------------------------------
+#Defining application name
+APPNAME=mailleur
+#defining local default domain
+DFLTDOMAIN="localdomain"
+#------------------------------------------------
 #list of listening port to do SMTP protocole
 #format
 #protocol:ipnum:port:iteration[,protocol:ipnum:port:iteration]++
 #Defaults
 SMTPPORTS=":::5,smtps::465:3,smtp::587:2"
 #------------------------------------------------
-#Defining application name
-APPNAME=mailleur
-#defining default domain
-DFLTDOMAIN="localdomain"
-#------------------------------------------------
 #Defining SERVER mode Certificate data
 CA_ROOT_SRV="/etc/pki/mailleur/root-safe_CA.pem"
 CA_CERT_SRV="/etc/pki/mailleur/mailleur-cert.pem"
index c3b73cb6abb65e33f03bdcf2dea325eae8b6f149..7e674d0be5b2ce762ef27c589ca59bd80701dc6d 100644 (file)
@@ -1,6 +1,11 @@
 #file used to set environment configuration
 #Used for developpement purpose ONLY
 #------------------------------------------------
+#Defining application name
+APPNAME=mailleur
+#defining local default domain
+DFLTDOMAIN="example.com""
+#------------------------------------------------
 #list of listening port to do SMTP protocole
 #format
 #protocol:ipnum:port:iteration[,protocol:ipnum:port:iteration]++
 #: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     "       "::"
-#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 default domain
-DFLTDOMAIN     =       "example.com"
+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"
-CA_CERT_SRV    =       "./certs/mailleur_server-chain-cert_x509.pem"
-CA_KEY_SRV     =       "./certs/mailleur_server-key.pem"
-CA_VERIFY_SRV  =       0       #to check PEER/client remote certificate
+CA_ROOT_SRV="./certs/root-safe_CA.pem"
+CA_CERT_SRV="./certs/mailleur_server-chain-cert_x509.pem"
+CA_KEY_SRV="./certs/mailleur_server-key.pem"
+CA_VERIFY_SRV=0        #to check PEER/client remote certificate
 #------------------------------------------------
 #Defining CLIENT mode Certificate data
-CA_ROOT_CLT    =       "./certs/root-safe_CA.pem"
-CA_CERT_CLT    =       "./certs/localhost-chain-cert.pem"
-CA_KEY_CLT     =       "./certs/localhost-key.pem"
-CA_VERIFY_CLT  =       0       #to check PEER/server remote certificate
+CA_ROOT_CLT="./certs/root-safe_CA.pem"
+CA_CERT_CLT="./certs/localhost-chain-cert.pem"
+CA_KEY_CLT="./certs/localhost-key.pem"
+CA_VERIFY_CLT=0        #to check PEER/server remote certificate
 #------------------------------------------------
 #Configured for Postgresql database
-DB_TYPE                =       POSTGRESQL
-DB_NAME                =       mailleur
-DB_HOST                =       localhost
-DB_PORT                =       5432
+DB_TYPE=POSTGRESQL
+DB_NAME=mailleur
+DB_HOST=localhost
+DB_PORT=5432
 #------------------------------------------------
 #Dovecot storage directory
-DOV_MAILDIR    =       "/var/spool/mailleur/mails"
+DOV_MAILDIR="/var/spool/mailleur/mails"
 #------------------------------------------------
index 7593d0a7a51ff364ab12dd19188aff89e90c4319..d663038d01a75d27eb620e679a0e9c375bb58be0 100644 (file)
@@ -143,6 +143,11 @@ toremake:  Makefile
 #--------------------------------------------------------------------
 .PHONY:        clean
 #--------------------------------------------------------------------
+#to set the compiled default library
+ifeq ($(strip $(DB)),)
+DB=1
+endif
+#--------------------------------------------------------------------
 CC     = gcc
 LD     = gcc
 CFLAGS = -Wall -D_GNU_SOURCE                                   \
index c2cd20d13675d27714b0d247093af20126b48e01..5e443aea07849f924c104def5ef311d17554877d 100644 (file)
@@ -459,13 +459,13 @@ while (proceed==true) {
           *ptr='\000';
           ptr++;
           }
-        for (int j=0;j<3;j++) {
+        for (int j=0;(j<3)&&(seq!=(char *)0);j++) {
           char *sofar;
 
-          if ((sofar=strchr(seq,':'))==(char *)0)
-            break;
-          *sofar='\000';
-          sofar++;
+          if ((sofar=strchr(seq,':'))!=(char *)0) {
+            *sofar='\000';
+            sofar++;
+            }
           switch (j) {
             case 0      :       //extracting protocol
               if ((proto=tls_getprotocol(seq))==pro_unknwn) {
@@ -483,7 +483,7 @@ while (proceed==true) {
             case 2      :       
               if (strlen(seq)>0)
                 port=seq;
-              if (strlen(sofar)>0)
+              if ((sofar!=(char *)0)&&(strlen(sofar)>0))
                 iteration=atoi(sofar);
               break;
             }
index 1ea0d7976c8b3ce0cee067e5082f1d7d9c24a72c..ba9b9d990ebe169f4c8913e8499f65822a456340 100755 (executable)
@@ -10,7 +10,7 @@ while [ $# -gt 0 ]
   numfile=$((numfile+1))
   numline=0
   echo "scanning \"$1\" test file"
-  cat $1 | while read line
+  while read line
     do
     numline=$((numline+1))
     data=`echo $line | grep -o '^[^#]*'`
@@ -21,11 +21,15 @@ while [ $# -gt 0 ]
     domain=`echo $data | cut -d ' ' -f2`
     ipnum=`echo $data | cut -d ' ' -f3`
     result=`bin/chkspf $domain $ipnum`
+    echo -n "done bin/chkspf $domain $ipnum "
     if [ "$result" != "$expect" ] ; then
-      echo "error: line $numline, Expected:=$expect Result:=$result"
+      echo "Fail!"
       numerr=$((numerr+1))
+      echo -e "\tError=$numerr\tline $numline, Expected:=$expect Result:=$result"
+    else 
+      echo "Success"
       fi
-    done 
+    done < $1
   shift
   done
 echo "number of test file scanned: $numfile, total error reported: $numerr";