;;; Copyright © 2020 Ludovic Courtès ;;; ;;; This program is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . ;;; Run with: ;;; ;;; guix environment --ad-hoc guile mailutils -- \ ;;; guile -L modules -e main -s send-en-masse.scm ;;; (use-modules (email) (rnrs io ports) ((mailutils mailutils) #:select (mu-message-set-header))) (define (endorsement-message) "Return the endorsement message, signed." (let ((text (call-with-input-file "sc-email.txt" get-string-all))) (compose-message ;;"Ludovic Courtès " "=?utf-8?Q?Ludovic_Court=C3=A8s?= " "ludo@gnu.org" #:subject "Endorsement of the GNU Social Contract" #:text text #:reply-to "social-contract@gnu.tools" #:user-agent "GNU Guile + GNU Mailutils" #:sign? #t))) (define %maintainers ;; (call-with-input-file "email-addresses.scm" read) '("ludo+test@gnu.org")) (define (main . args) (let ((message (endorsement-message))) (format #t "emailing ~a people~%" (length %maintainers)) (for-each (lambda (address) (format #t "emailing '~a'...~%" address) (mu-message-set-header message "To" address #t) (send-message message) (sleep 1)) %maintainers)))