I use getmail to download e-mails from mail mail server to my laptop, and maildrop to place them into the correct folders.
Today I got a bunch of mails, but two of them had errors:
cweiske@frm:~$ gm getmail version 6.19.07 Copyright (C) 1998-2025 Charles Cazabon and others. Licensed under GPL-2.0. SimpleIMAPSSLRetriever:cweiske@cweiske.de@mail.cweiske.de:993: [...] [INBOX] msg 80/87 (7284 bytes) not retrieved (seen) Delivery error (command maildrop 533549 error (75, /usr/bin/maildrop: Unable to open mailbox.)) [INBOX] msg 81/87 (6285 bytes) from <volkszaehler-users-bounces@demo.volkszaehler.org>, delivery error (command maildrop 533549 error (75, /usr/bin/maildrop: Unable to open mailbox.)) [INBOX] msg 82/87 (9688 bytes) from <volkszaehler-users-bounces@demo.volkszaehler.org>, delivery error (command maildrop 533550 error (75, /usr/bin/maildrop: Unable to open mailbox.)) [INBOX] msg 83/87 (9586 bytes) not retrieved (seen) [...] 2 messages (15973 bytes) retrieved, 85 skipped Summary: Retrieved 2 messages (15973 bytes) from SimpleIMAPSSLRetriever:cweiske@cweiske.de@mail.cweiske.de:993
A blog post by Paul Gear gave me the idea to use strace to see what's happening:
$ strace -f getmail [...] [pid 535072] newfstatat(AT_FDCWD, "/home/cweiske/Mail/cweiske@cweiske.de//.Trash/tmp", 0x7ffdf0ca5f00, 0) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden) [...] [pid 535072] openat(AT_FDCWD, "/home/cweiske/Mail/cweiske@cweiske.de//.Trash/", O_WRONLY|O_CREAT, 0666) = -1 EISDIR (Ist ein Verzeichnis)
maildrop wanted to write into the .Trash/tmp directory which did not exist. I checked: My maildir had a .trash and a .Trash directory, the first filled, the second not.
My .mailfilter rule was wrong:
if ( /^Subject:.*\[SPAM\]/ ) to $DEFAULT/.Trash/
After changing .Trash to .trash everything worked.