]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Starting to populate database
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Tue, 24 Jun 2025 12:28:24 +0000 (08:28 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Tue, 24 Jun 2025 12:28:24 +0000 (08:28 -0400)
Makefile
lib/modrec.c
sql/Makefile [new file with mode: 0644]
sql/mailleur.sql

index 26f503e684ff07f6b79260b1fa2b5389278ac4d4..95a154df6a7a4ae914b419255696d1e79f52c6b8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -231,6 +231,7 @@ install     :
 SUBDIR =                                               \
           lib                                          \
           app                                          \
+          sql                                          \
 
 #--------------------------------------------------------------------
 #definitions globale
index 2c676ce4bb7b089e6a5cf930ac373f07e0795f2c..86767c09eb4854e9bc9dc69a626321f2c7e4c793 100644 (file)
@@ -55,7 +55,8 @@ for (int i=0;i<argc;i++) {
   char *ptr;
   char config[80];
 
-  (void) strncpy(config,argv[i],sizeof(config));
+  (void) memset(config,'\000',sizeof(config));
+  (void) strncpy(config,argv[i],sizeof(config)-2);
   ptr=config;
   iteration=1;
   proto=pro_smtp; 
diff --git a/sql/Makefile b/sql/Makefile
new file mode 100644 (file)
index 0000000..92be5b1
--- /dev/null
@@ -0,0 +1,18 @@
+#--------------------------------------------------------------------
+#Generate database for postgresql and mysql
+#--------------------------------------------------------------------
+prod                                           \
+debug                                          \
+       :  mailleur.postg mailleur.mysql
+
+mailleur.postg                                 \
+       :  mailleur.sql
+          cpp -P -DPOSTGRESQL  mailleur.sql > mailleur.postg
+
+mailleur.mysql                                 \
+       :  mailleur.sql
+          cpp -P -DMYSQL       mailleur.sql > mailleur.mysql
+
+#--------------------------------------------------------------------
+clean  :
+          @ rm -fr mailleur.mysql mailleur.postg
index c4354a4acf8a06b89f3becdb9d7bb803258a3c55..efd7d4d39800feaa05448d8c5f1898f001c6d992 100644 (file)
 #define CRYPTED         MEDIUMBLOB
 #endif
 
+/********************************************************/
+/********************************************************/
+/*                                                     */
+/*     User available email definition table           */
+/*                                                     */
+/********************************************************/
+CREATE TABLE emails    (
+       email   TEXT,           //user email
+       space   INTEGER         //space used by user email      
+               DFLT 0,
+       mxspace INTEGER         //Maximun space available
+               DFLT 20000      //to user (20 Gig).
+       );