afewmail / afew

an initial tagging script for notmuch mail
ISC License
325 stars 98 forks source link

What if INBOX name is empty? (as in 'folder:""') #302

Open atrent opened 3 years ago

atrent commented 3 years ago

I'm trying to config an INBOX filter but since I'm using maildir++ my config file would be something like:

[MailMover]
folders = ""
rename = False
max_age = 2

# rules
"" = 'subject:prova':systems

but this does not work, how could I workaround it?

Thank you

P.S. I'm attaching an excerpt of notmuch-search-term man:

  folder:<maildir-folder> or folder:/<regex>/
              The folder: prefix searches for email messages by maildir or MH folder. For MH-style folders, this is equivalent to path:. For maildir, this
              includes messages in the "new" and "cur" subdirectories. The exact syntax for maildir  folders  depends  on  your  mail  configuration.  For
              maildir++, folder:"" matches the inbox folder (which is the root in maildir++), other folder names always start with ".", and nested folders
              are separated by "."s, such as folder:.classes.topology. For "file system" maildir, the inbox is typically folder:INBOX and  nested  folders
              are separated by slashes, such as folder:classes/topology.

              folder: will find a message if any copy of that message is in the specific folder.
GuillaumeSeren commented 3 years ago

Hello ! can you show more about the maildir struture, I guess you could find a way to define the folder/subfolder couple, I have to look into the MailMover to see, but I need more details.

atrent commented 3 years ago

mail maildir is something like:

$ ls Maildir/
cur
new
tmp
(+ dovecot files)

and subfolders are like:

$ ls -a Maildir
.folder1
.folder2
.folder3
...
(every .folder has cur/new/tmp subfolders)
atrent commented 3 years ago

currently my workaround is to move everything form inbox into a "pending" folder with imapfilter, then I can use something such as:

pending = 'subject:prova':systems

and it works

GuillaumeSeren commented 3 years ago

Hey @atrent

so you have maildir inside maildir right ?

Can you show a terminal / verbose call of the issue ?