[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#31737: 26.1.50; Gnus does not use mailutils movemail

From: Robert Pluim
Subject: bug#31737: 26.1.50; Gnus does not use mailutils movemail
Date: Thu, 14 Jun 2018 14:14:28 +0200

Eli Zaretskii <address@hidden> writes:

>> From: Robert Pluim <address@hidden>
>> Cc: Eli Zaretskii <address@hidden>,  Colin Baxter <address@hidden>,  
>> address@hidden
>> 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

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
+(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
-                        (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))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]