I'd like to configure the GNU Mailutils mail program so that it operates on an already existing maildir directory. Currently my mailutils.rc looks like this:
mailbox{
mailbox-pattern "maildir:///home/${user}/Maildir";
mailbox-type maildir;
}
This allows me to read mail from that folder, but nevertheless, the mail program always moves all opened mails to /home/${user}/mbox
. Is there a way to tell mail to keep the files at their original position?
I was able to reproduce your problem with GNU Mailutil's
mail
. I did not find a direct answer to your question, but found a solution to your problem.I suppose you configured your local MTA (Exim) so that new mail is delivered to
$HOME/Maildir/
, i.e. your Exim configuration is set todc_localdelivery='maildir_home'
.Install
heirloom-mailx
which provides a replacement of mailx and offers more functionality than GNU Mailutil's version of mailx. Make sure it is the actual provision ofmailx
in the alternatives config. Usually it is, because heirloom has the highest priority. You can check that like this:Configure mailx with the environment variable
$MAIL
. Since this configuration implies that mail is delivered for all users to their respective local Maildir I suppose this is the most elegant way to do this:No need to chmod 755 this file, since it will be sourced by the login shell. However you need to log off and on in order to let environment variable changes take effect.
Proof of concept:
Problem solved. Question remains: Do you need to stick with GNU Mailutil's mailx? I doubt so. Maybe it is possible to get this done with GNU, but since heirloom offers a superset of functions and you can still use other tools from Mailtutils, I would not bother to invest further research. heirloom is a nice piece of software. YMMV and HTH.
Have fun!