ezmlm-idx

17 maggio 2014 by Roberto Puzzanghera 0 commenti

ezmlm è un software di D.J. Bernstein per la gestione di mailing-list. E' semplice e veloce. ezmlm-idx è un'estensione di ezmlm.

Compilazione:

wget http://ezmlm.untroubled.org/archive/7.2.2/ezmlm-idx-7.2.2.tar.gz
tar xzf ezmlm-idx-7.2.2.tar.gz
cd ezmlm-idx-7.2.2
chown -R root:root .
cd lang
ln -s en_US default
cd ..
make
make man

Test:

# ./ezmlm-test

getconfopt library:   OK
ezmlm-make:           OK
Using subdb plugin:   std
ezmlm-reject:         OK
ezmlm-[un|is]sub[n]:  OK
ezmlm-checksub:       OK
ezmlm-send:           OK
ezmlm-tstdig:         OK
ezmlm-weed:           OK
ezmlmrc contents:     OK
ezmlm-clean:          OK
ezmlm-store:          OK
ezmlm-return:         OK
ezmlm-warn (1/2):     OK
ezmlm-manage (1/2):   OK
ezmlm-request:        OK
ezmlm-split:          OK
ezmlm-gate:           OK
ezmlm-idx:            OK
ezmlm-get (index):    OK
ezmlm-get (get):      OK
ezmlm-get (thread):   OK
ezmlm-get (digest):   OK
ezmlm-manage (2/2):   OK
ezmlm-moderate:       OK
ezmlm-warn (2/2):     OK
ezmlm-archive:        OK
ezmlm-dispatch:       OK                                                                                                                    
dispatch editor:      OK                                                                                                                    
decode sender:        OK                                                                                                                    
Verifying message header and body contents...                                                                                               
flags:                OK                                                                                                                    
substitutions:        OK                                                                                                                    
messages:             OK                                                                                                                    
subscribe nop:        OK                                                                                                                    
unsubscribe nop:      OK                                                                                                                    
subscribe probe:      OK                                                                                                                    
unsubscribe probe:    OK
subscribe:            OK
unsubscribe:          OK
moderated subscribe:  OK
moderated unsub:      OK
subscribe by mod:     OK
unsubscribe by mod:   OK
copylines:            OK
ezmlm-send:           OK
ezmlm-send trailer:   OK
omitbottom (-manage): OK
omitbottom (-get):    OK
Cleaning up...

Installazione:

make install

Installazione del supporto per mysql

NB: E' da molto tempo che non uso più il supporto a mysql e la seguente sezione non è più aggiornata.

Il vantaggio principale di avere il supporto a MySQL è poter accedere facilmente al DB attraverso un programma di scripting come perl, java, PHP.

Sfortunatamente il supporto a mysql non sembra però funzionare (ogni commento al riguardo sarebbe benvenuto). Creando infatti una lista con il supporto a mysql via qmailadmin il database non viene popolato e inviando un messaggio alla lista si ottiene il seguente errore di qmail-send log:

@400000005364eb332209c884 delivery 2761: deferral: ezmlm-checksub:_fatal:_Could_not_load_plugin_/usr/local/lib/ezmlm/sub-10.0.0.3.so:_/usr/local/lib/ezmlm/sub-10.0.0.3.so:_cannot_open_shared_object_file:_No_such_file_or_directory/

10.0.0.3 è l'IP del mio host mysql. Evidentemente il programma cerca la libreria sub-10.0.0.3.so anzichè sub-mysql.so.

Ad ogni modo ecco come installare il supporto mysql per ezmlm-idx:

Creare il database

# mysql -u root -p

CREATE USER 'ezmlm'@'[mailserver-IP]' IDENTIFIED BY '[ezmlm-password]';

GRANT USAGE ON * . * TO 'ezmlm'@'[mailserver-IP]' IDENTIFIED BY '[ezmlm-password]' WITH MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0
MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

CREATE DATABASE IF NOT EXISTS `ezmlm` ;
GRANT ALL PRIVILEGES ON `ezmlm` . * TO 'ezmlm'@'[mailserver-IP]';

Si si ha mysql installato in un percorso non standard (per default il prefix /usr), sarà necessario modificare alcuni file conf, e magari anche patchare i sorgenti. Io ho mysql sotto /usr/local/mysql questo è ciò che ho modificato:

# nano conf-cc
gcc -O -g -I/usr/local/mysql/include

# nano conf-ld
cc -g -rdynamic -B /usr/local/mysql/lib

Durante la compilazione ho anche avuto degli errori, dovuti al fatto che mysql è in /usr/local/mysql. Questa è la patch che ho applicato per risolvare:

diff -ruN ezmlm-idx-7.2.0/sub-mysql.c ezmlm-idx-7.2.0-patched/sub-mysql.c
--- ezmlm-idx-7.2.0/sub-mysql.c 2014-05-03 00:07:29.000000000 +0200
+++ ezmlm-idx-7.2.0-patched/sub-mysql.c 2014-05-03 14:53:43.000000000 +0200
@@ -6,7 +6,7 @@
 #include "subdb.h"
 #include <sys/types.h>
 #include <mysql.h>
-#include <mysql/errmsg.h>
+#include <errmsg.h>
 #include <mysqld_error.h>
 
 static stralloc line = {0};

Compilazione:

make mysql

Test:

# ./ezmlm-test -s mysql -u ezmlm -p [ezmlm-password] -h [mailserver-IP]

getconfopt library:   OK
ezmlm-make:           OK
Using subdb plugin:   mysql
ezmlm-reject:         OK
ezmlm-[un|is]sub[n]:  OK
ezmlm-checksub:       OK
ezmlm non-SQL:        OK
ezmlm SQL:            OK
ezmlm-send:           OK
ezmlm-tstdig:         OK
ezmlm-weed:           OK
ezmlmrc contents:     OK
ezmlm-clean:          OK
ezmlm-store:          OK
ezmlm-return:         OK
ezmlm-warn (1/2):     OK
ezmlm-manage (1/2):   OK
ezmlm-request:        OK
ezmlm-split:          OK
ezmlm-gate:           OK
ezmlm-idx:            OK
ezmlm-get (index):    OK
ezmlm-get (get):      OK
ezmlm-get (thread):   OK
ezmlm-get (digest):   OK
ezmlm-manage (2/2):   OK
ezmlm-moderate:       OK
ezmlm-warn (2/2):     OK
ezmlm-archive:        OK
ezmlm-dispatch:       OK
dispatch editor:      OK
decode sender:        OK
Verifying message header and body contents...
flags:                OK
substitutions:        OK
subscribe nop:        OK
unsubscribe nop:      OK
subscribe probe:      OK
unsubscribe probe:    OK
subscribe:            OK
unsubscribe:          OK
moderated subscribe:  OK
moderated unsub:      OK
subscribe by mod:     OK
unsubscribe by mod:   OK
copylines:            OK
ezmlm-send:           OK
ezmlm-send trailer:   OK
omitbottom (-manage): OK
omitbottom (-get):    OK
Cleaning up...

A questo punto, se il test è andato a buon fine, si può installare il programma:

make install

Aggiungi un commento