From fd1588fc1068dd601834b7cfb73c16c50db97a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 28 Jan 2020 16:09:39 +0100 Subject: code: Add 'send-en-masse' program. * code/send-en-masse.scm: New file. --- code/send-en-masse.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 code/send-en-masse.scm (limited to 'code') diff --git a/code/send-en-masse.scm b/code/send-en-masse.scm new file mode 100644 index 0000000..36d3682 --- /dev/null +++ b/code/send-en-masse.scm @@ -0,0 +1,51 @@ +;;; 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))) -- cgit v1.2.1