From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 23 16:17:46 2018 Received: (at submit) by debbugs.gnu.org; 23 Aug 2018 20:17:46 +0000 Received: from localhost ([127.0.0.1]:59108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsw38-00061d-Au for submit@debbugs.gnu.org; Thu, 23 Aug 2018 16:17:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsw36-00061P-Pf for submit@debbugs.gnu.org; Thu, 23 Aug 2018 16:17:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsw2z-0002pg-Ti for submit@debbugs.gnu.org; Thu, 23 Aug 2018 16:17:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36456) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsw2y-0002pT-H1 for submit@debbugs.gnu.org; Thu, 23 Aug 2018 16:17:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsw2t-0005P8-Fl for bug-guix@gnu.org; Thu, 23 Aug 2018 16:17:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsvzL-0000Dd-CU for bug-guix@gnu.org; Thu, 23 Aug 2018 16:13:56 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21016) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsvzL-0000Bv-19 for bug-guix@gnu.org; Thu, 23 Aug 2018 16:13:51 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1535055211; cv=none; d=zoho.com; s=zohoarc; b=RDDjZpeWzc8brIH0VMRV0uVhgv3UBVnugQd9ej+QngHgwzlkpPj9mhjW+3/qqaH0GIaRsqsy5VfqzyxvHU/o3TKsNj5mY/XoT704XRWxmFFSfB/rEoCny7ubpGpFOPUuhtcV4YZbjxU9ah7UbiXQEmYxiS54+aBnXYaFljMtC+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1535055211; h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results; bh=gsLI2CKbiXVizeM0ARMIK2eUSdcIvWjEdDq5cWedRTc=; b=N+yLjwGVq7MgzqNwOPmYwcnf0HegdIVo2zuE6Jj7bDH7kvM80ukL/E2Xhq5B9pAs5aPRijEgorGakDG0NmIFO/4ZNU5asnjWBhpwqNw2mR6CwXVceWOVRdde35jos2DQVpPGpiwjmacJxhRcZBRHXIESSUUcgUntJGv8CxLDvlI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1535055211; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; l=1495; bh=gsLI2CKbiXVizeM0ARMIK2eUSdcIvWjEdDq5cWedRTc=; b=EAMMJA2FevxwW9uYKRcdtYospYhs7A9Od15RDlJes5mU2Ao5z5i70jfObMFyqYc6 8yYOpDDH8N04V4InoCVHvRlaHFnn2C6J6fWUvoul1xXbbILNDQZv5p8a/yjdB537lzR XcjY8i8/BpbDtCbgV5gc756YPIGEQhbUngXPPTpo= Received: from localhost (port-92-200-11-116.dynamic.qsc.de [92.200.11.116]) by mx.zohomail.com with SMTPS id 1535055208838192.8772482448527; Thu, 23 Aug 2018 13:13:28 -0700 (PDT) User-agent: mu4e 1.0; emacs 26.1 From: Ricardo Wurmus To: bug-guix@gnu.org Subject: mailutils Guile bindings are broken X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Thu, 23 Aug 2018 22:13:25 +0200 Message-ID: <87bm9ssuxm.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) There are at least three problems with the Guile bindings for mailutils: 1. the Guile source files are not compiled. 2. the Guile source files are installed to $out/share/guile/site/ and are thus not found with =E2=80=9C,use (mailutils mailutils)=E2=80=9D in a G= uile REPL. 3. the Guile session segfaults when loading the module: --8<---------------cut here---------------start------------->8--- rekado in debbugs [env]: guile GNU Guile 2.2.4 Copyright (C) 1995-2017 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (add-to-load-path "/gnu/store/50lg0i5rqw1g7nf0ar2afgs7= 88mgdjmq-mailutils-3.4/share/guile/site/") scheme@(guile-user)> ,use (mailutils mailutils) ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /gnu/store/50lg0i5rqw1g7nf0ar2afgs788mgdjmq-mailutils-3.4/sha= re/guile/site/mailutils/mailutils.scm ;;; compiled /home/rekado/.cache/guile/ccache/2.2-LE-8-3.A/gnu/store/50lg0i= 5rqw1g7nf0ar2afgs788mgdjmq-mailutils-3.4/share/guile/site/mailutils/mailuti= ls.scm.go Segmentation fault rekado in debbugs [env]: --8<---------------cut here---------------end--------------->8--- Are the bindings not usable with Guile 2.2? -- Ricardo From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 24 06:39:36 2018 Received: (at 32514) by debbugs.gnu.org; 24 Aug 2018 10:39:37 +0000 Received: from localhost ([127.0.0.1]:59354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ft9VA-0005iv-CH for submit@debbugs.gnu.org; Fri, 24 Aug 2018 06:39:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ft9V8-0005ij-SV for 32514@debbugs.gnu.org; Fri, 24 Aug 2018 06:39:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ft9V0-0003Zn-Jz for 32514@debbugs.gnu.org; Fri, 24 Aug 2018 06:39:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ft9V0-0003ZQ-E6; Fri, 24 Aug 2018 06:39:26 -0400 Received: from [193.50.110.186] (port=58450 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ft9V0-0007Ss-53; Fri, 24 Aug 2018 06:39:26 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Ricardo Wurmus Subject: Re: bug#32514: mailutils Guile bindings are broken References: <87bm9ssuxm.fsf@elephly.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Fructidor an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 24 Aug 2018 12:39:24 +0200 In-Reply-To: <87bm9ssuxm.fsf@elephly.net> (Ricardo Wurmus's message of "Thu, 23 Aug 2018 22:13:25 +0200") Message-ID: <87pny8oxpf.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32514 Cc: 32514@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Ricardo Wurmus skribis: > Are the bindings not usable with Guile 2.2? No, but I have good news: those in Mailutils master are usable. Here=E2=80= =99s a recipe: --8<---------------cut here---------------start------------->8--- (define-public mailutils-next ;; This version of Mailutils supports Guile 2.2, unlike version <=3D 3.4. (let ((commit "62666075e3c7276d308dffef42c7c50dc526925b") (revision "0")) (package (inherit mailutils) (version (string-append (package-version mailutils) "-" revision "." (string-take commit 7))) (source (origin (method git-fetch) (uri (git-reference (url "https://git.savannah.gnu.org/git/mailutils.git") (commit commit) (recursive? #t))) ;for Gnulib & co. (sha256 (base32 "1m4cbjn02hklp6li14ajfzfg29ibbk38n0c3g8vyfx71iy0pxpnb")) (file-name (string-append "mailutils-" version "-checkout")= ))) (outputs '("out" "debug")) (inputs `(("guile" ,guile-2.2) ("gsasl" ,gsasl) ;for SMTP authentication ,@(alist-delete "guile" (package-inputs mailutils)))) (native-inputs `(("autoconf" ,autoconf-wrapper) ("automake" ,automake) ("libtool" ,libtool) ("gettext" ,gnu-gettext) ,@(package-native-inputs mailutils))) (arguments (substitute-keyword-arguments (package-arguments mailutils) ((#:modules modules %gnu-build-system-modules) `((srfi srfi-1) ,@modules)) ((#:configure-flags flags ''()) `(cons* "--disable-radius" ;; Add "/2.2" to the installation directory. (string-append "--with-guile-site-dir=3D" (assoc-ref %outputs "out") "/share/guile/site/2.2") ,flags)) ((#:phases phases) `(modify-phases ,phases (replace 'bootstrap (lambda* (#:key inputs #:allow-other-keys) (for-each patch-shebang '("bootstrap" "gnulib/gnulib-tool")) (substitute* "bootstrap.conf" (("git submodule" all) (string-append "#" all))) (for-each make-file-writable (find-files "gnulib")) (substitute* "configure.ac" (("AM_GNU_RADIUS") "")) (invoke "./bootstrap" "--no-git" "--skip-po" (string-append "--gnulib-srcdir=3Dgnulib")) #t)) (delete 'prepare-test-suite))) ((#:parallel-build? _ #f) ;due to parser.y #f) ((#:tests? _ #f) ;XXX #f)))))) --8<---------------cut here---------------end--------------->8--- Below is a simple example to get started. The Mailutils API is not this complicated but it took me a while to figure it out, so you might find that module helpful. Happy emailing! :-) Ludo=E2=80=99. --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline; filename=email.scm Content-Transfer-Encoding: quoted-printable Content-Description: the email module ;;; This module is licensed under the same terms, those of the GNU GPL ;;; version 3 or (at your option) any later version. ;;; ;;; Copyright =C2=A9 2018 Ludovic Court=C3=A8s (define-module (email) #:use-module ((guix build utils) #:select (dump-port)) #:use-module (guix base64) #:use-module (rnrs io ports) #:use-module (rnrs bytevectors) #:use-module (mailutils mailutils) #:export (compose-message send-message)) ;; This variable is looked up by 'mu-message-send', uh! (define-public mu-debug 0) (define* (insert-newlines str #:optional (line-length 76)) "Insert newlines in STR every LINE-LENGTH characters." (let loop ((result '()) (str str)) (if (string-null? str) (string-concatenate-reverse result) (let* ((length (min (string-length str) line-length)) (prefix (string-take str length)) (suffix (string-drop str length))) (loop (cons (string-append prefix "\n") result) suffix))))) (define* (compose-message from to #:key text subject file) "Compose a message, and return a message object." (let* ((mime (mu-mime-create)) (message (mu-message-create)) (body (mu-message-get-port message "w"))) (mu-message-set-header message "Content-Type" "text/plain; charset=3Dutf-8") (put-bytevector body (string->utf8 text)) (close-port body) (mu-mime-add-part mime message) (when file (let* ((attach (mu-message-create)) (port (mu-message-get-port attach "w"))) (display (insert-newlines (base64-encode (call-with-input-file file get-bytevector-all))) port) (close-port port) (mu-message-set-header attach "Content-Transfer-Encoding" "base64") (mu-message-set-header attach "Content-Type" "image/jpeg") (mu-message-set-header attach "Content-Disposition" "inline") (mu-mime-add-part mime attach))) (let ((result (mu-mime-get-message mime))) (mu-message-set-header result "From" from) (mu-message-set-header result "To" to) (when subject (mu-message-set-header result "Subject" subject)) result))) (define (display-body message) ;debug (let ((port (mu-message-get-port message "r"))) (dump-port port (current-error-port)) (close-port port))) (define (send-message message) "Send MESSAGE, a message returned by 'compose-message', using the SMTP parameters found in ~/.config/smtp." (define uri ;; Something like "smtp://USER:SECRET@SERVER:PORT" (info "(mailutils) ;; SMTP Mailboxes"). (call-with-input-file (string-append (getenv "HOME") "/.config/smtp") read)) (mu-register-format "smtp") (mu-message-send message uri)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 24 06:40:02 2018 Received: (at 32514) by debbugs.gnu.org; 24 Aug 2018 10:40:02 +0000 Received: from localhost ([127.0.0.1]:59357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ft9VY-0005jX-0J for submit@debbugs.gnu.org; Fri, 24 Aug 2018 06:40:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ft9VW-0005jL-Ct for 32514@debbugs.gnu.org; Fri, 24 Aug 2018 06:39:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ft9VO-0003zD-48 for 32514@debbugs.gnu.org; Fri, 24 Aug 2018 06:39:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ft9VN-0003z0-VS; Fri, 24 Aug 2018 06:39:50 -0400 Received: from [193.50.110.186] (port=58452 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ft9VN-0007Ti-MB; Fri, 24 Aug 2018 06:39:49 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Ricardo Wurmus Subject: Re: bug#32514: mailutils Guile bindings are broken In-Reply-To: <87bm9ssuxm.fsf@elephly.net> (Ricardo Wurmus's message of "Thu, 23 Aug 2018 22:13:25 +0200") References: <87bm9ssuxm.fsf@elephly.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Fructidor an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 24 Aug 2018 12:39:48 +0200 Message-ID: <87o9dsoxor.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32514 Cc: 32514@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Ricardo Wurmus skribis: > Are the bindings not usable with Guile 2.2? No, but I have good news: those in Mailutils master are usable. Here=E2=80= =99s a recipe: --8<---------------cut here---------------start------------->8--- (define-public mailutils-next ;; This version of Mailutils supports Guile 2.2, unlike version <=3D 3.4. (let ((commit "62666075e3c7276d308dffef42c7c50dc526925b") (revision "0")) (package (inherit mailutils) (version (string-append (package-version mailutils) "-" revision "." (string-take commit 7))) (source (origin (method git-fetch) (uri (git-reference (url "https://git.savannah.gnu.org/git/mailutils.git") (commit commit) (recursive? #t))) ;for Gnulib & co. (sha256 (base32 "1m4cbjn02hklp6li14ajfzfg29ibbk38n0c3g8vyfx71iy0pxpnb")) (file-name (string-append "mailutils-" version "-checkout")= ))) (outputs '("out" "debug")) (inputs `(("guile" ,guile-2.2) ("gsasl" ,gsasl) ;for SMTP authentication ,@(alist-delete "guile" (package-inputs mailutils)))) (native-inputs `(("autoconf" ,autoconf-wrapper) ("automake" ,automake) ("libtool" ,libtool) ("gettext" ,gnu-gettext) ,@(package-native-inputs mailutils))) (arguments (substitute-keyword-arguments (package-arguments mailutils) ((#:modules modules %gnu-build-system-modules) `((srfi srfi-1) ,@modules)) ((#:configure-flags flags ''()) `(cons* "--disable-radius" ;; Add "/2.2" to the installation directory. (string-append "--with-guile-site-dir=3D" (assoc-ref %outputs "out") "/share/guile/site/2.2") ,flags)) ((#:phases phases) `(modify-phases ,phases (replace 'bootstrap (lambda* (#:key inputs #:allow-other-keys) (for-each patch-shebang '("bootstrap" "gnulib/gnulib-tool")) (substitute* "bootstrap.conf" (("git submodule" all) (string-append "#" all))) (for-each make-file-writable (find-files "gnulib")) (substitute* "configure.ac" (("AM_GNU_RADIUS") "")) (invoke "./bootstrap" "--no-git" "--skip-po" (string-append "--gnulib-srcdir=3Dgnulib")) #t)) (delete 'prepare-test-suite))) ((#:parallel-build? _ #f) ;due to parser.y #f) ((#:tests? _ #f) ;XXX #f)))))) --8<---------------cut here---------------end--------------->8--- Below is a simple example to get started. The Mailutils API is not this complicated but it took me a while to figure it out, so you might find that module helpful. Happy emailing! :-) Ludo=E2=80=99. --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline; filename=email.scm Content-Transfer-Encoding: quoted-printable Content-Description: the email module ;;; This module is licensed under the same terms, those of the GNU GPL ;;; version 3 or (at your option) any later version. ;;; ;;; Copyright =C2=A9 2018 Ludovic Court=C3=A8s (define-module (email) #:use-module ((guix build utils) #:select (dump-port)) #:use-module (guix base64) #:use-module (rnrs io ports) #:use-module (rnrs bytevectors) #:use-module (mailutils mailutils) #:export (compose-message send-message)) ;; This variable is looked up by 'mu-message-send', uh! (define-public mu-debug 0) (define* (insert-newlines str #:optional (line-length 76)) "Insert newlines in STR every LINE-LENGTH characters." (let loop ((result '()) (str str)) (if (string-null? str) (string-concatenate-reverse result) (let* ((length (min (string-length str) line-length)) (prefix (string-take str length)) (suffix (string-drop str length))) (loop (cons (string-append prefix "\n") result) suffix))))) (define* (compose-message from to #:key text subject file) "Compose a message, and return a message object." (let* ((mime (mu-mime-create)) (message (mu-message-create)) (body (mu-message-get-port message "w"))) (mu-message-set-header message "Content-Type" "text/plain; charset=3Dutf-8") (put-bytevector body (string->utf8 text)) (close-port body) (mu-mime-add-part mime message) (when file (let* ((attach (mu-message-create)) (port (mu-message-get-port attach "w"))) (display (insert-newlines (base64-encode (call-with-input-file file get-bytevector-all))) port) (close-port port) (mu-message-set-header attach "Content-Transfer-Encoding" "base64") (mu-message-set-header attach "Content-Type" "image/jpeg") (mu-message-set-header attach "Content-Disposition" "inline") (mu-mime-add-part mime attach))) (let ((result (mu-mime-get-message mime))) (mu-message-set-header result "From" from) (mu-message-set-header result "To" to) (when subject (mu-message-set-header result "Subject" subject)) result))) (define (display-body message) ;debug (let ((port (mu-message-get-port message "r"))) (dump-port port (current-error-port)) (close-port port))) (define (send-message message) "Send MESSAGE, a message returned by 'compose-message', using the SMTP parameters found in ~/.config/smtp." (define uri ;; Something like "smtp://USER:SECRET@SERVER:PORT" (info "(mailutils) ;; SMTP Mailboxes"). (call-with-input-file (string-append (getenv "HOME") "/.config/smtp") read)) (mu-register-format "smtp") (mu-message-send message uri)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 24 14:21:01 2018 Received: (at 32514-done) by debbugs.gnu.org; 24 Aug 2018 18:21:01 +0000 Received: from localhost ([127.0.0.1]:59957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftGhh-0006Vo-A4 for submit@debbugs.gnu.org; Fri, 24 Aug 2018 14:21:01 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21071) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftGhe-0006Ve-T5 for 32514-done@debbugs.gnu.org; Fri, 24 Aug 2018 14:20:59 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1535133931; cv=none; d=zoho.com; s=zohoarc; b=W1InrUb9WNv+PQ4FN1PYEEpAgfSNBb0YDFRruEBN10PXfMpSzYmLDI6BQB9GF9eQbx3JdDzUc+Q9IAeWwKt2H9+UsvIp/P4LeONa7WKGtJKzDL36v1S1O2jtxzlw4E2khqETLVEb/846Q0rTwH6W+EF69Gd4f9UQkq8fLdhVIXw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1535133931; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=K5IelN98b06MUT0ox6TlBhtBFO/NGQKZcXc4ZKsf4Vo=; b=I4XziQNccd3rwfPZDh01BLi7Blb55L4IMlC4pD+igbDy23PdN/dz0tZvELDjClWp5SQ95AkXo8MtnwtFTZiScjU3td4xn8T8J2OxZNyccHqbSHT4j+N9OyWBLudNYtiQCctW4VXbvJQWb7GAwfQvrop2t2YAnd4tfRdcyNXbCXQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1535133931; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; l=703; bh=K5IelN98b06MUT0ox6TlBhtBFO/NGQKZcXc4ZKsf4Vo=; b=Q73/YzrgIE8lRSpvge7DCce6Fngc2l+aHHPgPmY4wQ9ihB/PwsVIyPensj80Htua rGQpYRCgdDY++ADzffGj4fhlHz7fZpXSxpt7SU/M4iJIWXIn6Fq63m5BNmZoewWTC9s aJjQD0dZWM4b7Op0FhrPnoKo0x5I0dou1ayvQJLA= Received: from localhost (port-92-200-49-220.dynamic.qsc.de [92.200.49.220]) by mx.zohomail.com with SMTPS id 1535133930098313.9117320885923; Fri, 24 Aug 2018 11:05:30 -0700 (PDT) References: <87bm9ssuxm.fsf@elephly.net> <87pny8oxpf.fsf@gnu.org> User-agent: mu4e 1.0; emacs 26.1 From: Ricardo Wurmus To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#32514: mailutils Guile bindings are broken In-reply-to: <87pny8oxpf.fsf@gnu.org> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Fri, 24 Aug 2018 20:05:26 +0200 Message-ID: <87zhxbr66x.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32514-done Cc: 32514-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi! >> Are the bindings not usable with Guile 2.2? > > No, but I have good news: those in Mailutils master are usable. Here=E2= =80=99s > a recipe: [=E2=80=A6] > Below is a simple example to get started. The Mailutils API is not this > complicated but it took me a while to figure it out, so you might find > that module helpful. Thank you! I was hoping to use some procedures from Mailutils to simplify parsing Debbugs emails, so that I don=E2=80=99t have to implement, say, a parser for Quoted Printable string encodings. I=E2=80=99ll play with this for a while. I=E2=80=99m closing this bug now, because I guess this will all be fine wit= h the next release. -- Ricardo From unknown Sun Jun 22 11:40:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 22 Sep 2018 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator