mainGNU Mailutils - Support: sr #109516, Mailutils saves read messages in...

 
 

sr #109516: Mailutils saves read messages in ~/mbox instead of ~/Maildir

Submitter:  None
Submitted:  Fri 15 Jun 2018 04:14:25 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  4 - Important Status:  Invalid
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 15 Jun 2018 06:39:02 AM UTC, comment #1: 

Hello,

This behavior is mandated by the Open Group POSIX Specification. According to the spec:

"Incoming mail shall be stored in one or more unspecified locations for each user, collectively called the system mailbox for that user. When mailx is invoked in Receive Mode, the system mailbox shall be the default place to find new mail. As messages are read, they shall be marked to be moved to a secondary file for storage, unless specific action is taken. This secondary file is called the mbox and is normally located in the directory referred to by the HOME environment variable (see MBOX in the ENVIRONMENT VARIABLES section for a description of this file). Messages shall remain in this file until explicitly removed. When the -f option is used to read mail messages from secondary files, messages shall be retained in those files unless specifically removed. All three of these locations-system mailbox, mbox, and secondary file-are referred to in this section as simply "mailboxes", unless more specific identification is required."

The ENVIRONMENT VARIABLES section states the following

"MBOX
     Determine a pathname of the file to save messages from the system mailbox that have been read. The exit command shall override this function, as shall saving the message explicitly in another file. The default shall be mbox in the directory named by the HOME variable."

For a detailed discussion, please see http://pubs.opengroup.org/onlinepubs/9699919799/, and http://mailutils.org/manual/html_section/mail.html#Saving-Messages.

To summarize:

  1. There are two distinct mailboxes for each user: the system mailbox, which receives incoming messages, and the secondary mailbox, which is used for storing read messages.
  2. Default name for the secondary mailbox is ~/mbox.
  3. The name of the secondary mailbox can be changed by setting the environment variable MBOX.
  4. The default behavior upon normal exit from the program is to move to the secondary mailbox all messages that are marked as read during the interactive session.
  5. This behavior can be disabled by setting the hold variable. When this variable is set, the messages will be held in the system mailbox until explicitly moved elsewhere.
  6. Setting secondary mailbox to be the same as the system mailbox results in undefined behavior.


Judging by your message, you would need the p.5.

Another issue raised by your posting is that of mailbox visibility to the imap4d server. It is defined by the server namespaces and is discussed in detail in http://mailutils.org/manual/html_section/imap4d.html#Namespace.

Hope that helps.

Sergey Poznyakoff <gray>
Group administrator
Fri 15 Jun 2018 04:14:25 AM UTC, original submission:  

Mailutils is configured to use the mailbox ~/Maildir. Mail reads from ~/Maildir/new, but it saves held messages to ~/mbox/cur rather than ~/Maildir/cur. Mail creates an entirely separate maildir folder hierarchy at ~/mbox.  On exit, the appropriate flags are set (:2,R).

The result is that it is then impossible to access these messages from a remote IMAP client.

Environment


Ubuntu server 18.04 LTS (4.15.0-23-generic)
mailutils 3.4-1
dovecot 2.2.33.2 (d6601f4ec)
postfix 3.3.0-1

/etc/mailutils.conf


mailbox {
  mailbox-pattern "maildir:///home/${user}/Maildir";
  mailbox-type maildir;
};

~/.profile


MAIL=$HOME/Maildir

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gray (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-11 gray Open/ClosedOpen Closed
    2018-06-15 gray StatusNone Invalid

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code