From: Jean-Marc Pigeon (Delson) Date: Wed, 27 Aug 2025 16:41:29 +0000 (-0400) Subject: setting unienv withing mailleur.php X-Git-Tag: end-0.15~61 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=b96967dc8c72ab588c0e75ae4968a67cd3b257ea;p=jmp%2Fmailleur setting unienv withing mailleur.php --- diff --git a/; b/; deleted file mode 100644 index ebfaaeb..0000000 --- a/; +++ /dev/null @@ -1,294 +0,0 @@ -#==================================================================== -#Makefile to build the package -#default make -default : clean prod -#-------------------------------------------------------------------- -#test area Makefile -include Makefile.dbg -#distribution area Makefile -include Makefile.dist -#-------------------------------------------------------------------- -#Executable generation area -#-------------------------------------------------------------------- -prod \ -debug \ - : - @ for i in $(SUBDIR) ; \ - do \ - $(MAKE) DB=$(DB) -s -C $$i $@ ; \ - done - - - -clean : cleanrpm - @ for i in $(SUBDIR) ; \ - do \ - $(MAKE) -s -C $$i $@ ; \ - done - @ - rm -fr $(APPNAME)-* - -posql : clean debug - @ ln -nsf bin-posql bin - @ $(MAKE) -s newtest - -mysql : clean debug - @ ln -nsf bin-mysql bin - @ $(MAKE) -s newtest - -#==================================================================== -FEEDPAR = \ - $(TESTIP) \ - $(TESTPORT) \ - ./$(DATATST)/feed0*.tst - -#to test with an external server -extfeed : debug - @ bin-utils/feeder \ - -f \ - -d3 \ - -c ./conf/feeder.conf.dvl \ - $(EXTIP) \ - $(EXTPORT) \ - ./$(DATATST)/$(ONEFEED) - - -#direct test -tstfeed : debug - @ bin-utils/feeder \ - -c ./conf/$(APPNAME).conf.dvl \ - $(FEEDPAR) - - - -#using gdb -dbgfeed : debug - @ gdb \ - --args \ - bin-utils/feeder \ - -f \ - -d 2 \ - -c ./conf/$(APPNAME).conf.dvl \ - $(TESTIP) \ - $(TESTPORT) \ - ./$(DATATST)/$(ONEFEED).tst - -valfeed : debug #valgring of emlrcvr - @ echo "feed valgrind test" - @ valgrind \ - --leak-check=full \ - --show-leak-kinds=$(VALKIND) \ - bin-utils/feeder \ - -f \ - -d2 \ - -c ./conf/feeder.conf.dvl \ - $(TESTIP) \ - $(TESTPORT) \ - ./$(DATATST)/$(ONEFEED) - - -# --track-fds=yes \ -#testing TLS connection -tlsrcvr : - @ clear - openssl s_client \ - -trace \ - -crlf \ - -status \ - -CAfile /etc/pki/tls/make-ca/ca-bundle.crt \ - -cert certs/localhost-cert.pem \ - -key certs/localhost-key.pem \ - -starttls smtp \ - -connect mailpostg.example.com:25 -# -connect smtp1.example.com:25 -# -connect courriel.colba.net:25 -# -connect mx1.free.fr:25 -# -connect $(TESTSRV):$(TESTPORT) - -tlsmx1 : - @ clear - openssl s_client \ - -trace \ - -crlf \ - -status \ - -CAfile /etc/pki/tls/make-ca/ca-bundle.crt \ - -cert certs/localhost-cert.pem \ - -key certs/localhost-key.pem \ - -starttls smtp \ - -connect mx1.free.fr:25 - -go465 : - @ clear - @ openssl s_client \ - -crlf \ - --showcerts \ - -key certs/localhost-key.pem \ - -cert_chain certs/localhost-chain-cert.pem \ - -CAfile /etc/pki/tls/make-ca/ca-bundle.crt \ - -tls1_2 \ - -connect $(TESTIP):1025 - -# -status -# -crlf -# -msg -# -debug -# -showcerts -# -tls1_2 -# -connect mailpostg.example.com:25 -# -connect $(TESTSRV):$(TESTPORT) -# -connect smtp.google.com:25 -# -connect courriel.colba.net:25 -# -#testing TLS with google -tlsref: - @ clear - @ openssl s_client \ - -quiet \ - -crlf \ - -CAfile /etc/pki/tls/make-ca/ca-bundle.crt \ - -cert certs/localhost-cert.pem \ - -key certs/localhost-key.pem \ - -starttls smtp \ - -connect tar1.osukiss.org:25 - -# -connect mx2.free.fr:25 -# -connect tar1.orukiss.org:25 -# -connect mailprod1.safe.ca:587 -# -connect tar1.osukiss.org:25 -# -connect smtp.google.com:25 -# -connect courriel.colba.net:25 -# -connect courriel.colba.net:587 -# -connect mailmysql.example.com:25 -# -connect $(TESTSRV):$(TESTPORT) - -#-------------------------------------------------------------------- -#starting email receiver - -eml465 : prepare - @ echo - @ echo "--------------" - @ echo "starting $@" - @ $(TESTDIR)/$(SBINDIR)/emlrcvr \ - -c ./conf/$(APPNAME).conf.dvl \ - -d 1 \ - -r $(TESTDIR) \ - smtps:$(TESTIP):1065:1 - - -prepare : clean debug newtest - -#-------------------------------------------------------------------- -#test procedure -#-------------------------------------------------------------------- -#testing SPF fonction -tstspf : clean debug - @ shell/test-spf.sh data-spf/spf.tst - -#todo a specfic test -#DATA = chkaddr.spf.example.com 127.0.1.255 - -#-------------------------------------------------------------------- -#preparing a test area -newtest : deltest - @ mkdir -p $(TESTDIR)/var/run - @ mkdir -p $(TESTDIR)/$(SBINDIR) - @ mkdir -p $(TESTDIR)/etc/$(APPNAME) - @ mkdir -p $(TESTDIR)/usr/share/$(APPNAME) - @ mkdir -p $(TESTDIR)/var/spool/$(APPNAME)/queue - @ mkdir -p $(TESTDIR)/var/spool/$(APPNAME)/mails - @ mkdir -p $(TESTDIR)/usr - @ cp -a \ - conf/* \ - $(TESTDIR)/etc/$(APPNAME) - @ cp -a \ - sql \ - $(TESTDIR)/usr/share/$(APPNAME)/ - @ $(MAKE) -s -C sql prepdb - -deltest : - @ rm -fr $(TESTDIR) - -#-------------------------------------------------------------------- -#Installation procedure -#-------------------------------------------------------------------- -install : - @ # Creating all needed system directory - @ install -d $(DESTDIR)/$(DATADIR)/$(APPN)/ - @ install -d $(DESTDIR)/$(ETCDIR)/$(APPN)/ - @ install -d $(DESTDIR)/$(ETCDIR)/$(APPN)/dovecot - @ install -d $(DESTDIR)/$(ETCDIR)/pki/$(APPN)/ - @ install -d $(DESTDIR)/$(ETCDIR)/sysconfig/ - @ install -d $(DESTDIR)/$(ETCDIR)/httpd/conf.d/ - @ install -d $(DESTDIR)/$(ETCDIR)/cron.d/ - @ install -d $(DESTDIR)/$(LIBDIR)/$(APPN)/ - @ install -d $(DESTDIR)/$(EXECDIR)/$(APPN)/ - @ install -d $(DESTDIR)/$(SPOOLDIR)/$(APPN)/mails - @ install -d $(DESTDIR)/$(SPOOLDIR)/$(APPN)/queue - @ install -d $(DESTDIR)/var/www/$(APPN)/ - @ cp -a \ - bin-*/ \ - $(DESTDIR)/$(EXECDIR)/$(APPN) - @ cp -a \ - conf/$(APPN).conf \ - conf/relayed.conf \ - conf/blacklister.conf \ - $(DESTDIR)/$(ETCDIR)/$(APPN) - @ cp -a \ - conf/$(APPN)-httpd.conf \ - $(DESTDIR)/$(ETCDIR)/httpd/conf.d/$(APPN).conf - @ cp -a \ - conf/dovecot \ - $(DESTDIR)/$(ETCDIR)/$(APPN)/ - @ cp -a \ - certs/root-safe_CA.pem \ - $(DESTDIR)/$(ETCDIR)/pki/$(APPN)/ - @ cp -a \ - linux \ - $(DESTDIR)/$(DATADIR)/$(APPN)/ - @ cp -a \ - shell \ - support \ - $(DESTDIR)/$(LIBDIR)/$(APPN)/ - @ cp -a \ - sysconfig \ - $(DESTDIR)/$(ETCDIR)/ - @ cp -a \ - cron/$(APPN).cron \ - $(DESTDIR)/$(ETCDIR)/cron.d/ - @ cp -a \ - sql \ - $(DESTDIR)/$(DATADIR)/$(APPN)/ - @ cp -a \ - www \ - $(DESTDIR)/var/www/$(APPN)/ - @ ln -s \ - $(DESTDIR)/www/$(APPN)/mailleur.php \ - $(DESTDIR)/var/www/$(APPN)/index.php - - -#-------------------------------------------------------------------- -SUBDIR = \ - lib \ - app \ - tools \ - sql \ - -#-------------------------------------------------------------------- -#definitions globale -APPNAME = mailleur -#-------------------------------------------------------------------- -#to set the compiled default library -ifeq ($(strip $(DB)),) -DB=0 -endif -#-------------------------------------------------------------------- -#Managing testarea -LIBDIR = /usr/lib -DATADIR = /usr/share -SBINDIR = /usr/sbin -SPOOLDIR= /var/spool -EXECDIR = /usr/libexec -ETCDIR = /etc -CURDIR = $(shell pwd) -#-------------------------------------------------------------------- -.PHONY: clean cleanrpm -#=================================================================== diff --git a/www/mailleur.php b/www/mailleur.php index 9bd3566..ff76b1e 100644 --- a/www/mailleur.php +++ b/www/mailleur.php @@ -4,8 +4,12 @@ function body($action,$logname,$pass) { +include "unienv.php"; include "scrfun.php"; +loadenv(); $footer=footer("mailleur"); +$dbtype=getenv("DB_TYPE"); +$dbport=getenv("DB_PORT"); $STR = << @@ -23,6 +27,9 @@ action=$action Login=$logname
Password=$pass +
+DBTYPE=$dbtype; DBPORT=$dbport + $footer diff --git a/www/unienv.php b/www/unienv.php index bc74f25..89cc2ad 100644 --- a/www/unienv.php +++ b/www/unienv.php @@ -9,7 +9,6 @@ function loadenv() { $env_file_path="/etc/mailleur/mailleur.conf"; -$var_arrs=array(); $phase=0; $proceed=true; while ($proceed==true) { @@ -41,7 +40,6 @@ while ($proceed==true) { if (isset($env_ex[1])) $env_value=trim($env_ex[1]); putenv("$env_name=$env_value"); - echo ("$env_name is equal to <$getenv($env_name)>\n"); } break; case 3 : //closing file @@ -55,5 +53,4 @@ while ($proceed==true) { } } -loadenv(); ?>