Thanks, very much! On Fri, 16 Oct 2020 19:56:11 +1100 Cameron Simpson <cs@xxxxxxxxxx> wrote: > On 16Oct2020 00:15, Ranjan Maitra <maitra@xxxxxxxxx> wrote: > >On Fri, 16 Oct 2020 10:14:48 +1100 Cameron Simpson <cs@xxxxxxxxxx> wrote: > >> Mostly the races. > >> > >> To add, remove or flag in MH probably requires a locking mechanism while > >> updating the message number lists (and correspondingly, allocating new > >> message numbers). You also don't know an arriving message is complete unless > >> it isn't numbered yet; I imagine an MH insert goes > >> save-completely-to-tempfile, allocate-number, rename-tempfile-to-number, > >> update-number-lists. A lock would need to be held over the last three > >> steps. > > > >This may be a stupid question, but does this problem still happen if I use fetchmail to pull mail and store messages in files via procmail? > > Well, it is an issue regardless of the tool. procmail may do the initial > placement, but your mail reader probably moves messages around, if only > from one folder to another, which is the same task (new message in > target folder). I see, yes, that is possible, but I have not seen this problem for me. Perhaps the way I have (inadvertently) used it so far may be the reason, or I have been plain fortuitous. > > >In my experience, messages have been given unique numbers in their respective folders. (Of course, my MH is really not MH, but rather sylpheed-mh, since they do not update the .mh_sequences but use .sylpheed_mark. > > Well, the requirement for MH is of course that they have unique numbers > because their filenames are so named. The important thing is that > delivery tools cooperate - more than one tool might be trying to deliver > to the folder at once, and only one can work on the .mh_sequences or > .sylpheed_mark files at a time. So: locking. > > Maildir lets you do this without locking because of the noncolliding filename > approach, and the "is this message file complete?" issue by doing all > preparation in the tmp subdir, before renaming the completed file into the > new subdir. I see, this makes sense. Thanks for the explanation. > > >> Maildir is race free. Messages get unqiue filenames (composed of various > >> sufficently unique values combined), are created in the "tmp" subdir, > >> and renamed into the "new" subdir. Read messages are renamed from "new" > >> to "cur". No shared number lists, no locks. You only look for messages > >> in "new" and "cur". > > > >Thanks very much for this. I have found a tool that can convert mh to mailbox: > > > >https://github.com/vuntz/mh2maildir/blob/master/mh2maildir > > > >It seems to work, but can not handle a second level of subfolders: brings them all out as individual folders at the first level, so Ihave to fix that. Also, I don't like the new folder names, seem too unnecessary for me. (I was expecting to the old MH folder names inside my Maildir.) Also, the mails get stored as something like: 1602799622.116065_21187.hostname:2, not sure if this is the recommended way that files are stored in the Maildir format. I was expecting to have something that I could have control over. > > Yah. I wrote one when I made this switch: > > https://hg.sr.ht/~cameron-simpson/css/browse/bin/mh2maildir?rev=tip > > Hmm, some years ago now, looking at the opening comment. And I'm using > procmail for the conversion (!!!), so indeed quite a while ago. This > script moves the MH folder sideways and makes an empty Maildir in its > place, then delivers every message from the MH folder into the new > maildir. Thanks very much for this! I will try it out, but it appears to be for individual folders, is that correct? So, I will maybe write a script to call it. > > These days I'd use mutt for the bulk conversion instead of procmail. You can > see an example of that approach in this script: > > https://hg.sr.ht/~cameron-simpson/css/browse/bin/mboxify?rev=tip > I see, this is for converting to mbox and needs to be modified for > >I have to look into this some more. I am not sure if this is the standard way to store Maildir format messages. > > mutt doesn't care - there's no "standard". There was a recent discussion > on mutt-users with another user moving to Maildir, who had nested > folders. He's still got nested folders, exactly as before. Just don't > name a subfolder like one of the three reserved names: "tmp", "new", > "cur". > > So do it how you like it. Yes, that is what I would like: I do not have any subfolders with one of the three Maildir subfolders as a name. According to this post here: https://www.systoolsgroup.com/maildir/ the filename has this "gator3018.hostgator.com" which I presume comes from the hostname. How do I get this changed to something else (unique, but not to the hostname)? Is this where mutt or procmail is to be told to do this, how? > > >One aspect of MH that I have liked is that I pull mail on two machines (using fetchmail via a POP server) and they are assigned the same filenames (numbers). Then, if I use rsync with delete, I can delete the corresponding message in the remote machine if I have deleted it on my local machine. It has worked like a charm over the past 15 years (I would say). > > Ah. This is a little trickier with Maildir, because message flags are > stored in the filename. If you change the flags on both machines > without an rsync in between you might run into trouble. With MH the > flags are in the .mh-sequences file IIRC. You've still have an > equivalent problem though - I presume you're excluding the .mh_sequences > files from the rsync? So, sylpheed does not use or update the .mh_sequences but makes its own mark which is where it keeps all the information on the status of a message (read, replied, flagged, etc). I do send it up. > > Is one of your machines considered the "main" machine where you read and > maintain email, and the other a backup? Or do you delete at both ends? The reason for how I set things up, and that has worked reasonably well, is (you sort of guessed it) that I read e-mail at work and home, but the work machine is the one that I consider to be reliably backed up. It is also bigger in terms of disk. So what happens is that I fetchmail with keep, process e-mail at work using sylpheed and then fire up my home machine (a laptop) and fetchmail with keep from the POP server and the rsync it down (including the .sylpheed_mark and .sylpheed_cache). Then I work on the home machine, continue to fetchmail process e-mails, etc with sylpheed and when I am done (before I hibernate), I rsync it all up before I go back to work, so that when I go to the other (work) machine, I have the same status as I left at home/work. It has worked reasonably well. > > I use getmail via a POP server to collect my email to my laptop. I use > rsync with Maildirs in my backup process to the home server backup volume. > > >Thanks, I think that I am also coming round to the view that I should stick to mutt. The listed neomutt features are: https://neomutt.org/feature. I do not know what is not also in mutt. But in any case, I probably won't know the difference. (I don't completely understand all the features.) > > Mainline mutt has the sidebar patch and I think the trash folder. I'm > unsure about the rest. I index my mail with notmuch, but outside of > mutt. > > >I want to read my e-mail locally. Basically, run fetchmail or mbsync in the background to get mail and store in local folders at intervals, then have mutt read them, etc. I like storing my e-mail locally so that I can get to it offline. > > Same! > > So I run getmail every 30s to poll my mail and pull it locally. I have > postfix configured on my laptop, so sending email is just done with > sendmail. If I'm online it goes straight out, and if not it queues until > I am online. Thanks, I have currently been using postfix too, but will probably try mutt's smtp (now that they have enabled office365 oauth2 support). Postfix has not yet done so, they have done some with gmail, but it is not completely clear to me yet how to use that with MS Office365. Same with msmtp, it seems. Thanks again for all the nice discussion! Best wishes, Ranjan _______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx