Hi Ken and Norm, > > fetchmail runs off a deamon and deposits emails which are in fine > > nmh format but do not have a numeric names. So I run this script: > > [...] > > But after the scan is complete and before I do the rmm, the script > > might have put a new message in +inbox, which rmm would remove. > > There aren't _wonderful_ solutions, because this is a higher-level > problem; other programs can change the state of your inbox between > commands.
refile(1) could do with an option to not alter the current folder or current message. Norm is setting MHCONTEXT for the refile(1) to a temporary copy so that protects his main context file's ‘current-folder’ entry from being modified, but a folder's .mh_sequences file's ‘cur’ entry is still changed. I suppose appending ‘mh-sequences: .mh-sequences.$$’ to the new MHCONTEXT file would help because ‘cur’ would then be changed in there? Even if cur is protected, this script running in the background and altering the contents of +inbox will have unwanted results with commands like ‘rmm last:10’ so your main point is correct. I have fetchmail run in the background, but the local mail-delivery agent it hands them over to, Postfix, appends to the /var/$LOGNAME/mail mbox-format file whence inc(1) picks them up when it's run manually by me. Often because bash(1) is checking for new mail as described under ‘MAIL’, ‘MAILCHECK’, and ‘MAILPATH’. -- Cheers, Ralph.
