From: Jean-Marc Pigeon Date: Sat, 30 Aug 2025 09:05:31 +0000 (-0400) Subject: Adding syslog capability X-Git-Tag: end-0.15~47 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=4485646118def3eee4e164a82fd8c40ebd6987a5;p=jmp%2Fmailleur Adding syslog capability --- diff --git a/dbg/mailleur.conf b/dbg/mailleur.conf new file mode 100644 index 0000000..106b010 --- /dev/null +++ b/dbg/mailleur.conf @@ -0,0 +1,80 @@ +#file used to set environment configuration +#------------------------------------------------ +#Defining application name +APPNAME=mailleur +#root working directoy definition for the whole application +ROOTBASE="/" +#defining local default domain +DFLTDOMAIN="safe.ca" +#defining the local REALM +#Caution! the realm is hardcoded within data-base +#and USED too to hash the user passwd +#Changing this value coule be a trouble make +#(entering again ALL user password) +REALM="mailleur-email" +#------------------------------------------------ +#list of listening port to do SMTP protocole +#format +#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 +#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" +#Defaults +SMTPPORTS="|||5,smtps||465|3,smtp||587|2" +#------------------------------------------------ +#SSL Security level default value +#CIPHER_LIST="DEFAULT" +#SSL_SECURITY=2 +#------------------------------------------------ +#Defining SERVER mode Certificate data +CA_ROOT_SRV="/etc/pki/tls/make-ca/ca-bundle.crt" +CA_VERIFY_SRV=0 #to check PEER/client remote certificate +#If certificate set via do_dns_tlsa.sh (letsencrypt) +#CA_CERT_SRV="/etc/certbot/mailleur/mailleur-fullchain.pem" +#CA_KEY_SRV="/etc/certbot/mailleur/mailleur-key.pem" +#If certificate are self signed (default installation) +#CA_CERT_SRV="/etc/pki/mailleur/mailleur-cert.pem" +#CA_KEY_SRV="/etc/pki/mailleur/mailleur-key.pem" +#Symbolic link set at installation +CA_CERT_SRV="/etc/mailleur/pki/mailleur-cert.pem" +CA_KEY_SRV="/etc//mailleur/pki/mailleur-key.pem" +#------------------------------------------------ +#Defining CLIENT mode Certificate data +CA_ROOT_CLT="/etc/pki/tls/make-ca/ca-bundle.crt" +CA_VERIFY_CLT=0 #to check PEER/server remote certificate +#If certificate set via do_dns_tlsa.sh (letsencrypt) +#CA_CERT_CLT="/etc/certbot/mailleur/mailleur-fullchain.pem" +#CA_KEY_CLT="/etc/certbot/mailleur/mailleur-key.pem" +#If certificate are self signed (default installation) +#CA_CERT_CLT="/etc/pki/mailleur/mailleur-cert.pem" +#CA_KEY_CLT="/etc/pki/mailleur/mailleur-key.pem" +#Symbolic link set at installation +CA_CERT_CLT="/etc/mailleur/pki/mailleur-cert.pem" +CA_KEY_CLT="/etc/mailleur/pki/mailleur-key.pem" +#------------------------------------------------ +#Configured for Postgresql database +#DB_TYPE can be either POSTGRESQL,MYSQL, default POSTGRESQL +DB_TYPE=POSTGRESQL +DB_NAME=mailleur +DB_HOST=localhost +DB_PORT=5432 +DB_LANG="UTF-8" +#------------------------------------------------ +#Dovecot storage directory +DOV_MAILDIR="/var/spool/mailleur/mails" +#------------------------------------------------ +#The list of public blacklist serveur +BLACKLISTER=/etc/mailleur/blacklister.conf +#the list of IP from which we accept to relay email +RELAYABLE=/etc/mailleur/relayed.conf +#------------------------------------------------ +#Minimal credit level to which remote is rejected at once +#if credit is equal or below that level +RJCTCRED=-50 +#------------------------------------------------ diff --git a/www/mailleur.php b/www/mailleur.php index c545d9e..387480f 100644 --- a/www/mailleur.php +++ b/www/mailleur.php @@ -4,6 +4,7 @@ function body($action,$logname,$pass) { +include_once "subrou.php"; include_once "unienv.php"; include_once "scrfun.php"; include_once "devsql.php"; @@ -11,6 +12,8 @@ $footer=footer("mailleur"); $dbtype=getenv("DB_TYPE"); $conn=sql_connect(); sql_close($conn); +rou_alert(0,"This a syslog message"); +rou_closelog(); $STR = << +
$footer diff --git a/www/subrou.php b/www/subrou.php new file mode 100644 index 0000000..feb369f --- /dev/null +++ b/www/subrou.php @@ -0,0 +1,41 @@ +=$dbglvl) + syslog(LOG_INFO,"$report"); +} + +rou_openlog(); +?> diff --git a/www/unienv.php b/www/unienv.php index 48fb5bb..0e42e8c 100644 --- a/www/unienv.php +++ b/www/unienv.php @@ -12,7 +12,7 @@ $env_file_path="/etc/mailleur/mailleur.conf"; $phase=0; $proceed=true; while ($proceed==true) { - //echo ("unienv.c:loadenv JMPDBG phase='$phase'\n"); + rou_alert(2,"unienv.c:loadenv JMPDBG phase='$phase'"); switch ($phase) { case 0 : //checking if file exist if(!is_file($env_file_path)){ diff --git a/www/unipos.php b/www/unipos.php index a92126a..a9c630d 100644 --- a/www/unipos.php +++ b/www/unipos.php @@ -32,4 +32,3 @@ return 0; } ?> -?>