From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: m43cap@yandex.com, larsi@gnus.org, 31737@debbugs.gnu.org
Subject: bug#31737: 26.1.50; Gnus does not use mailutils movemail
Date: Thu, 14 Jun 2018 14:14:28 +0200 [thread overview]
Message-ID: <87r2l9a7kr.fsf@gmail.com> (raw)
In-Reply-To: <87sh5zk9br.fsf@gmail.com>
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Robert Pluim <rpluim@gmail.com>
>> Cc: Eli Zaretskii <eliz@gnu.org>, Colin Baxter <m43cap@yandex.com>, 31737@debbugs.gnu.org
>> Date: Wed, 13 Jun 2018 16:08:53 +0200
>>
>> Eli, were you thinking that mail-source should duplicate the movemail
>> detection logic in rmail? Or should it just assume Mailutils movemail
>> and pass '--emacs'?
>
> The former.
Something like this? Testing definitely required by someone who uses
mailutils movemail for Gnus. Not sure this is emacs-26 material
anymore.
diff --git i/lisp/gnus/mail-source.el w/lisp/gnus/mail-source.el
index d2850f4cee..99dc40c843 100644
--- i/lisp/gnus/mail-source.el
+++ w/lisp/gnus/mail-source.el
@@ -301,7 +301,7 @@ mail-source-idle-time-delay
:group 'mail-source
:type 'number)
-(defcustom mail-source-movemail-program nil
+(defcustom mail-source-movemail-program "movemail"
"If non-nil, name of program for fetching new mail."
:version "22.1"
:group 'mail-source
@@ -653,6 +653,12 @@ mail-source-delete-crash-box
mail-source-delete-incoming
mail-source-delete-old-incoming-confirm)))))))
+(defun mail-source-movemail-variant-p (variants)
+ "Return t if the current movemail variant is any of VARIANTS.
+See `rmail-movemail-variant-p' for details"
+ (let ((rmail-movemail-program mail-source-movemail-program))
+ (rmail-movemail-variant-p variant)))
+
(defun mail-source-movemail (from to)
"Move FROM to TO using movemail."
(if (not (file-writable-p to))
@@ -682,13 +688,20 @@ mail-source-movemail
(setq errors (generate-new-buffer " *mail source loss*"))
(let ((default-directory "/"))
(setq result
+ ;; call-proces looks in exec-path, which
+ ;; contains exec-directory, so will find
+ ;; Mailutils movemail if it exists, else it will
+ ;; find "our" movemail in exec-directory.
+ ;; Bug#31737
(apply
'call-process
(append
(list
- (or mail-source-movemail-program
- (expand-file-name "movemail" exec-directory))
- nil errors nil from to)))))
+ mail-source-movemail-program
+ nil errors nil)
+ (when (mail-source-movemail-variant-p 'mailutils)
+ (list "--emacs"))
+ (list from to)))))
(when (file-exists-p to)
(set-file-modes to mail-source-default-file-modes))
(if (and (or (not (buffer-modified-p errors))
next prev parent reply other threads:[~2018-06-14 12:14 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-06 19:23 bug#31737: 26.1.50; Gnus does not use mailutils movemail Robert Pluim
2018-06-06 19:47 ` Colin Baxter
2018-06-06 19:55 ` Robert Pluim
2018-06-08 15:33 ` Eli Zaretskii
2018-06-08 16:01 ` Robert Pluim
2018-06-08 18:15 ` Eli Zaretskii
2018-06-08 18:47 ` Robert Pluim
2018-06-08 19:20 ` Eli Zaretskii
2018-06-11 8:27 ` Robert Pluim
2018-06-11 15:20 ` Eli Zaretskii
2018-06-11 21:47 ` Robert Pluim
2018-06-12 2:29 ` Eli Zaretskii
2018-06-12 6:12 ` Colin Baxter
2018-06-12 14:41 ` Eli Zaretskii
2018-06-12 18:24 ` Lars Ingebrigtsen
2018-06-13 14:08 ` Robert Pluim
2018-06-13 16:42 ` Eli Zaretskii
2018-06-14 12:14 ` Robert Pluim [this message]
2018-06-14 13:04 ` Robert Pluim
2018-06-14 13:45 ` Eli Zaretskii
2018-06-14 14:37 ` Robert Pluim
2018-06-14 15:07 ` Eli Zaretskii
2018-06-14 22:54 ` Paul Eggert
2018-06-15 7:08 ` Eli Zaretskii
2018-06-15 7:42 ` Paul Eggert
2018-06-15 10:21 ` Colin Baxter
2018-06-15 11:19 ` Robert Pluim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r2l9a7kr.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=31737@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
--cc=m43cap@yandex.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.