Checking email in listname and adding an email to it.

This commit is contained in:
Dominik Pantůček 2023-04-06 21:04:27 +02:00
parent fec10f2d69
commit 98ab786ded

View file

@ -36,6 +36,7 @@
find-mailman-list
mailman-list-name
mailman-list-members
mailman-sync-members
)
(import scheme
@ -43,6 +44,7 @@
(chicken pathname)
(chicken string)
(chicken sort)
(chicken format)
utils
progress)
@ -113,8 +115,26 @@
(define (find-mailman-list lsts name)
(assoc name lsts))
;; Returns #t if the email is in given ml
(define (email-in-mailman-list? ml email)
(if (member email (mailman-list-members ml))
#t
#f))
;; Adds given email to given listname
(define (add-email-to-mailman-list listname email)
(let ((result
(get-mailman-output-lines
"add_members" "-r" "-" listname
(sprintf "<<<\"~A\"" email))))
(print result)))
(define (remove-email-from-mailman-list listname email)
#f)
;; Ensures given email is in given ML
(define (mailman-ensure-member ml email)
#f)
;; Makes sure given member is removed