#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"
#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"
#------------------------------------------------
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 '^[^#]*'`
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";