]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Starting to have index.php
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 25 Aug 2025 17:11:52 +0000 (13:11 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 25 Aug 2025 17:11:52 +0000 (13:11 -0400)
; [new file with mode: 0644]
Makefile
mailleur.spec.in

diff --git a/; b/;
new file mode 100644 (file)
index 0000000..ebfaaeb
--- /dev/null
+++ b/;
@@ -0,0 +1,294 @@
+#====================================================================
+#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
+#===================================================================
index bf26ead86e181fea432cacbc0e88e1de97955c2e..6a922da57251907f6fa3e93f9f5761861dbe907e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -257,9 +257,9 @@ install     :
           @ cp -a                                      \
                sql                                     \
                $(DESTDIR)/$(DATADIR)/$(APPN)/
-          @ ln -s                                      \
-               $(DESTDIR)/www/mailleur.php             \
-               $(DESTDIR)/www/index.php
+          @ cp -a                                      \
+               www/*                                   \
+               $(DESTDIR)/var/www/$(APPN)/
 
 
 #--------------------------------------------------------------------
index 1a04e5cabd8d154aed5f08105dc9fe65e926e649..531442b0ad46e2f86bc9109965a9c172955d65ee 100644 (file)
@@ -72,6 +72,7 @@ search about email exchange within time and transaction context.
 %attr(0755,%{name},mail) %dir %{spooldir}/%{name}/queue
 %attr(0750,%{name},mail) %dir %{spooldir}/%{name}/mails
 %attr(0750,%{name},apache) %dir %{wwwdir}/%{name}/
+%attr(0750,%{name},apache) %{wwwdir}/%{name}/*.php
 %attr(0640,root,root) %{_datadir}/%{name}/sql/Makefile
 %attr(0644,root,root) %{_datadir}/%{name}/sql/datatest.def
 %attr(0644,root,root) %{_datadir}/%{name}/sql/*.sql
@@ -124,6 +125,10 @@ if [ ! "$(getent passwd %{name})" ]; then
 
 %post
 OS=`%{_libdir}/%{name}/shell/getsysos.sh`
+ln -nsf                                                        \
+       ./%{name}.php                                   \
+       %{_var}/www/%{name}/index.php                   \
+
 if [ "$1" = 1 ]; then
   (
   echo "#------------------------------------------"