Start working on mailman integration.
This commit is contained in:
parent
409bf71156
commit
f6c7faff84
2 changed files with 62 additions and 2 deletions
10
src/Makefile
10
src/Makefile
|
@ -41,14 +41,15 @@ BBSTOOL-DEPS=bbstool.scm testing.import.scm listing.import.scm \
|
||||||
member-fees.import.scm members-dir.import.scm \
|
member-fees.import.scm members-dir.import.scm \
|
||||||
csv-simple.import.scm bank-account.import.scm \
|
csv-simple.import.scm bank-account.import.scm \
|
||||||
bank-fio.import.scm members-payments.import.scm \
|
bank-fio.import.scm members-payments.import.scm \
|
||||||
web-static.import.scm environment.import.scm
|
web-static.import.scm environment.import.scm \
|
||||||
|
mailman.import.scm
|
||||||
|
|
||||||
BBSTOOL-OBJS=bbstool.o testing.o listing.o month.o period.o ansi.o \
|
BBSTOOL-OBJS=bbstool.o testing.o listing.o month.o period.o ansi.o \
|
||||||
dictionary.o command-line.o members-base.o utils.o primes.o \
|
dictionary.o command-line.o members-base.o utils.o primes.o \
|
||||||
member-record.o configuration.o progress.o table.o cards.o \
|
member-record.o configuration.o progress.o table.o cards.o \
|
||||||
members-print.o member-fees.o members-dir.o csv-simple.o \
|
members-print.o member-fees.o members-dir.o csv-simple.o \
|
||||||
bank-account.o bank-fio.o members-payments.o member-parser.o \
|
bank-account.o bank-fio.o members-payments.o member-parser.o \
|
||||||
web-static.o environment.o
|
web-static.o environment.o mailman.o
|
||||||
|
|
||||||
.PHONY: imports
|
.PHONY: imports
|
||||||
imports: $(BBSTOOL-DEPS)
|
imports: $(BBSTOOL-DEPS)
|
||||||
|
@ -229,3 +230,8 @@ ENVIRONMENT-SOURCES=environment.scm ansi.import.scm
|
||||||
|
|
||||||
environment.o: environment.import.scm
|
environment.o: environment.import.scm
|
||||||
environment.import.scm: $(ENVIRONMENT-SOURCES)
|
environment.import.scm: $(ENVIRONMENT-SOURCES)
|
||||||
|
|
||||||
|
MAILMAN-SOURCES=mailman.scm utils.import.scm
|
||||||
|
|
||||||
|
mailman.o: mailman.import.scm
|
||||||
|
mailman.import.scm: $(MAILMAN-SOURCES)
|
||||||
|
|
54
src/mailman.scm
Normal file
54
src/mailman.scm
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
;;
|
||||||
|
;; mailman.scm
|
||||||
|
;;
|
||||||
|
;; Mailman management interface
|
||||||
|
;;
|
||||||
|
;; ISC License
|
||||||
|
;;
|
||||||
|
;; Copyright 2023 Brmlab, z.s.
|
||||||
|
;; Dominik Pantůček <dominik.pantucek@trustica.cz>
|
||||||
|
;;
|
||||||
|
;; Permission to use, copy, modify, and/or distribute this software
|
||||||
|
;; for any purpose with or without fee is hereby granted, provided
|
||||||
|
;; that the above copyright notice and this permission notice appear
|
||||||
|
;; in all copies.
|
||||||
|
;;
|
||||||
|
;; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||||
|
;; WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||||
|
;; WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||||
|
;; AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
|
||||||
|
;; CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||||
|
;; OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
;; NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||||
|
;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
;;
|
||||||
|
|
||||||
|
(declare (unit mailman))
|
||||||
|
|
||||||
|
(module
|
||||||
|
mailman
|
||||||
|
(
|
||||||
|
*mailman-bin*
|
||||||
|
list-mailman-lists
|
||||||
|
)
|
||||||
|
|
||||||
|
(import scheme
|
||||||
|
utils)
|
||||||
|
|
||||||
|
;; Where does the mailman binaries reside
|
||||||
|
(define *mailman-bin* (make-parameter "/usr/lib/mailman/bin"))
|
||||||
|
|
||||||
|
;; Returns full path to given mailman binary
|
||||||
|
(define (mailman-bin bin)
|
||||||
|
(make-path (*mailman-bin*) bin))
|
||||||
|
|
||||||
|
;; Mailman-specific process output lines capture
|
||||||
|
(define (get-mailman-output-lines bin)
|
||||||
|
(get-process-output-lines
|
||||||
|
(mailman-bin bin)))
|
||||||
|
|
||||||
|
;; Returns the list of available lists
|
||||||
|
(define (list-mailman-lists)
|
||||||
|
(get-mailman-output-lines "list_lists"))
|
||||||
|
|
||||||
|
)
|
Loading…
Add table
Add a link
Reference in a new issue