GNU bug report logs - #76595
29.4; Problem getting RMAIL to detect a change to the value of `rmail-movemail-program'.

Previous Next

Package: emacs;

Reported by: <tpeplt <at> gmail.com>

Date: Wed, 26 Feb 2025 18:17:02 UTC

Severity: normal

Found in version 29.4

Done: Eli Zaretskii <eliz <at> gnu.org>

To reply to this bug, email your comments to 76595 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#76595; Package emacs. (Wed, 26 Feb 2025 18:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to <tpeplt <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 26 Feb 2025 18:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <tpeplt <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.4; Problem getting RMAIL to detect a change to the value of
 `rmail-movemail-program'.
Date: Wed, 26 Feb 2025 13:16:38 -0500
Emacs Maintainers,

  There is a problem with getting Emacs/Rmail to use the
Mailutils version of ‘movemail’ if the value of
‘rmail-movemail-program’ is set after Rmail has been
started.

- Start Emacs with `emacs -Q'.

- Verify that the user option `rmail-movemail-program' is set to nil
  (the default).

- Start Rmail: M-x rmail

- Check the value of the variable `rmail-movemail-variant-in-use',
  which is set in the function `rmail-movemail-variant-p':

  C-h v rmail-movemail-variant-in-use [RET]

  Confirm that its values is 'emacs.

- Quit Rmail: Type 'q' in the RMAIL buffer.

- Kill the RMAIL buffer: C-x k RMAIL [RET]

- Set the value of the user option `rmail-movemail-program' to the
  absolute path to the Mailutils `movemail' program.

  Optionally, set the value of user option
  `rmail-primary-inbox-list' to a mailbox with the `pops' protocol,
  that is, "pops://USERNAME:[PASSWORD]@HOSTNAME:[PORT]".

- Set a breakpoint in the function `rmail-movemail-variant-p'.

- Start Rmail with: M-x rmail [RET]

- Stepping through `rmail-movemail-variant-p', note that the value of
  the variable `rmail-movemail-variant-in-use' is 'emacs.  This
  prevents the function from setting `rmail-movemail-variant-in-use'
  to 'mailutils.  This, in turn, prevents Rmail from using
  `rmail-movemail-program' to retrieve mail from the location(s) in
  `rmail-primary-inbox-list'.

- Without setting `rmail-movemail-variant-in-use' manually, it is
  necessary for a user to exit Emacs and restart it, then set the
  value of `rmail-movemail-program' to the absolute path to the
  Mailutils `movemail' program *before* starting Rmail.

Possibly, the fix for this is to change the code in the function
`rmail-movemail-variant-p' to check for a non-nil value for the
user option `rmail-movemail-program' (which is done later in the
call to the function `rmail-autodetect').

Or, in the function ‘rmail’, code could be added to reset the value
of ‘rmail-movemail-variant-in-use’ to nil, and then update the
description of what to do when `rmail-movemail-program' is set or
changed (that is, re-run ‘rmail’ command).

From (info "(emacs) Movemail"):

    The variable ‘rmail-movemail-program’ controls which version
    of ‘movemail’ to use.  If that is a string, it specifies the
    absolute file name of the ‘movemail’ executable.  If it is
    ‘nil’, Rmail searches for ‘movemail’ in the directories listed
    in ‘rmail-movemail-search-path’, then in ‘exec-path’
    (*note Shell::), then in ‘exec-directory’.

At a minimum, it seems that this variable should be reset
each time the command M-x rmail [RET] is given.  This would
not affect the run-time behavior of the `g' command
(`rmail-get-new-mail') in the RMAIL buffers, but would add
to the (re-)start time of RMAIL.

-- 
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76595; Package emacs. (Wed, 26 Feb 2025 19:34:02 GMT) Full text and rfc822 format available.

Message #8 received at 76595 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: <tpeplt <at> gmail.com>
Cc: 76595 <at> debbugs.gnu.org
Subject: Re: bug#76595: 29.4;
 Problem getting RMAIL to detect a change to the value of
 `rmail-movemail-program'.
Date: Wed, 26 Feb 2025 21:33:04 +0200
> Date: Wed, 26 Feb 2025 13:16:38 -0500
> From: <tpeplt <at> gmail.com>
> 
> Emacs Maintainers,
> 
>   There is a problem with getting Emacs/Rmail to use the
> Mailutils version of ‘movemail’ if the value of
> ‘rmail-movemail-program’ is set after Rmail has been
> started.

To avoid these complications, either customize rmail-movemail-program
in your init file, so it is already set to the value 'mailutils' when
you start Rmail, or simply remove the version of 'movemail' that came
with Emacs, so that the only 'movemail' Rmail can find is that from
Mailutils.

(If you build your Emacs yourself, you can configure Emacs with the
'--with-mailutils' configure-time option, in which case the Emacs
version of 'movemail' will not be built and will not be installed.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76595; Package emacs. (Wed, 26 Feb 2025 20:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 76595 <at> debbugs.gnu.org (full text, mbox):

From: <tpeplt <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 76595 <at> debbugs.gnu.org
Subject: Re: bug#76595: 29.4;
 Problem getting RMAIL to detect a change to the value of
 `rmail-movemail-program'.
Date: Wed, 26 Feb 2025 15:37:59 -0500
> Date: Wed, 26 Feb 2025 21:33:04 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: <tpeplt <at> gmail.com>
> > 
> > Emacs Maintainers,
> > 
> >   There is a problem with getting Emacs/Rmail to use the
> > Mailutils version of ‘movemail’ if the value of
> > ‘rmail-movemail-program’ is set after Rmail has been
> > started.
> 
> To avoid these complications, either customize rmail-movemail-program
> in your init file, so it is already set to the value 'mailutils' when
> you start Rmail, or simply remove the version of 'movemail' that came
> with Emacs, so that the only 'movemail' Rmail can find is that from
> Mailutils.
> 

Thank you for your response.

Yes, I understand how to resolve the problem (having spent a
considerable amount of time tracking it down while assuming
that I had made numerous mistakes).  The reason I sent in
the report is that there is an error in Emacs, either in the
documentation of how to use ‘movemail’ or in the rmail.el
file, depending on what the maintainers want to change.

The problem as it is now is that the behavior of Emacs and
the requirements for using movemail are not sufficiently
well documented.  Either or both could be fixed.  If the
code is not going to be changed, then the Emacs manual
should be updated to document that a change to
‘rmail-movemail-program’ may not take effect until Emacs is
restarted.

This is necessary so that new users of Rmail do not
encounter the problem that I described in the problem
report.  

A better solution might be to change the manual to say that
M-x rmail [RET] is required after changing
‘rmail-movemail-program’, and to change (defun rmail ...) to
(re-)initialize ‘rmail-movemail-variant-in-use’ to nil, but
that is a choice for you maintainers.

Possibly, the following code could be moved into (defun
rmail ...), also:

;; Call for effect, to set rmail-movemail-program (if not set by the
;; user), and rmail-movemail-variant-in-use. Used by various functions.
;; I'm not sure if M-x rmail is the only entry point to this package.
;; If so, this can be moved there.
(rmail-movemail-variant-p)

-- 
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 01 Mar 2025 13:48:03 GMT) Full text and rfc822 format available.

Notification sent to <tpeplt <at> gmail.com>:
bug acknowledged by developer. (Sat, 01 Mar 2025 13:48:03 GMT) Full text and rfc822 format available.

Message #16 received at 76595-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: tpeplt <at> gmail.com
Cc: 76595-done <at> debbugs.gnu.org
Subject: Re: bug#76595: 29.4;
 Problem getting RMAIL to detect a change to the value of
 `rmail-movemail-program'.
Date: Sat, 01 Mar 2025 15:47:44 +0200
> Date: Wed, 26 Feb 2025 15:37:59 -0500
> From:  <tpeplt <at> gmail.com>
> Cc: 76595 <at> debbugs.gnu.org
> 
> > Date: Wed, 26 Feb 2025 21:33:04 +0200
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > 
> > > From: <tpeplt <at> gmail.com>
> > > 
> > > Emacs Maintainers,
> > > 
> > >   There is a problem with getting Emacs/Rmail to use the
> > > Mailutils version of ‘movemail’ if the value of
> > > ‘rmail-movemail-program’ is set after Rmail has been
> > > started.
> > 
> > To avoid these complications, either customize rmail-movemail-program
> > in your init file, so it is already set to the value 'mailutils' when
> > you start Rmail, or simply remove the version of 'movemail' that came
> > with Emacs, so that the only 'movemail' Rmail can find is that from
> > Mailutils.
> > 
> 
> Thank you for your response.
> 
> Yes, I understand how to resolve the problem (having spent a
> considerable amount of time tracking it down while assuming
> that I had made numerous mistakes).  The reason I sent in
> the report is that there is an error in Emacs, either in the
> documentation of how to use ‘movemail’ or in the rmail.el
> file, depending on what the maintainers want to change.
> 
> The problem as it is now is that the behavior of Emacs and
> the requirements for using movemail are not sufficiently
> well documented.  Either or both could be fixed.  If the
> code is not going to be changed, then the Emacs manual
> should be updated to document that a change to
> ‘rmail-movemail-program’ may not take effect until Emacs is
> restarted.
> 
> This is necessary so that new users of Rmail do not
> encounter the problem that I described in the problem
> report.  
> 
> A better solution might be to change the manual to say that
> M-x rmail [RET] is required after changing
> ‘rmail-movemail-program’, and to change (defun rmail ...) to
> (re-)initialize ‘rmail-movemail-variant-in-use’ to nil, but
> that is a choice for you maintainers.
> 
> Possibly, the following code could be moved into (defun
> rmail ...), also:
> 
> ;; Call for effect, to set rmail-movemail-program (if not set by the
> ;; user), and rmail-movemail-variant-in-use. Used by various functions.
> ;; I'm not sure if M-x rmail is the only entry point to this package.
> ;; If so, this can be moved there.
> (rmail-movemail-variant-p)

Thanks, I decided to document how to customize this variable safely.

I'm therefore closing this bug.




This bug report was last modified 2 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.