[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mutt can not delete mails



On Thu 28 Oct 2021 at 16:16:58 (+0200), Hans wrote:
> Am Donnerstag, 28. Oktober 2021, 15:38:34 CEST schrieb Greg Wooledge:
> [ … ] This is step-by-step what I do:
> 
> Starting mutt from the commandline as normal user.  Mutt in ncurses appears. 
> Now I want to mark and delete all mails. I press Shift+D, then it asks the for 
> the sample and I press . (dot) and * (asterix). 
> 
> By pressing the "Enter" key all mails are marked ND+.
> 
> Now pressing "q" (for quit) and it asks me "20 as deletion marked mails 
> delete? ([yes]/no):" (Note, I have a German environment, so it asks me in 
> German. This sentence a translated by me).
>  
> I answer yes, and it appears "temporary file could not be created".
> 
> Pressing again "q" and now answer "no", mutt closes.
> 
> Does this help?

Not much, because there's no location information. I think you should
try running mutt with debugging set:

$ mutt -d 5   … and whatever else you normally put here …

This will generate a huge file called .muttdebug0, so don't do much
more beyond deleting a single message (with d) and then syncing the
mailbox (with $). Then quit, with x so that you don't get any more
complaints.

Now look at the end of .muttdebug0 file with less, and the last bit
should include something like 'Got op 87' (for x) or 'Got op 151
Mailbox is unchanged' (if you typed q).

Now search (backwards) for 'Writing /var/mail/', which should follow
something like 'Got op 130' where 130 is the opcode for sync.
Here's what you ought to see at this point:

 Got op 130
 Writing /var/mail/username...
 Sorting mailbox...
 ../../mbox.c:869: mutt_mktemp returns "/home/username/.mutt-cache/scratchpad/mutt-hostname-1234-56789-1122334455667788990".
 updating progress: 0
 Writing /var/mail/username... 0/31 (0%)
 Committing changes...
 30 kept, 1 deleted.
 Sorting mailbox...

and here's what I see when I temporarily make the mail file and its
directory owned by root:

 Got op 130
 Writing /var/mail/username...
 Sorting mailbox...
 Unable to lock mailbox!
 Sorting mailbox...

If you're running mutt on bullseye, the opcodes might be different,
hence searching for 'Writing /var/mail/' instead.

There should be some indication at this point of why it can't
delete your emails. The reason you see the filename
/home/username/.mutt-cache/scratchpad/mutt-hostname… above is
that I have set tmpdir="$HOME/.mutt-cache/scratchpad" in my
muttrc file. I use that, rather than /tmp, because it is encrypted
along with all of /home. But it means I have to clean it occasionally.

Cheers,
David.


Reply to: