[Alpine-info] Specify role's specific folder to match all sub-folders

kludev kludev at gmail.com
Sun Jan 8 03:11:46 PST 2023


Does this feature exist? I have a collection for my gmail account, I want
to set up a role to apply "Set FROM" and "Set SMTP" (and a few others), so
that as long as my current folder is in this collection, I can compose,
reply, forward using the corresponding account's SMTP.

Currently, I can only set up a role to specify individual folders (can be
multiple, or all of them). However as long as I added a new folder in
Gmail, the newly added folder won't trigger the role.

This is why I would like to have the aforementioned feature.

If not, I scratched a patch for this: One can specify a folder in the form
of `{some_server}somefolder*`, which will match the prefix to current open
folder. Wondering if it makes sense.


--- pith/pattern.c.orig 2023-01-08 02:53:16
+++ pith/pattern.c 2023-01-08 02:53:40
@@ -5484,7 +5484,8 @@
(streamfolder = strindex(&stream->mailbox[1], '}')) &&
(t = strindex(&patfolder[1], '}')) &&
(!strcmp(t+1, streamfolder+1) ||
- (*(t+1) == '\0' && !strcmp("INBOX", streamfolder+1))))
+ (*(t+1) == '\0' && !strcmp("INBOX", streamfolder+1)) ||
+ (t[strlen(t)-1] == '*' && strncmp(t+1, streamfolder+1, strlen(t+1)-1) == 0))
match++;

break;



More information about the Alpine-info mailing list