mutt stable branch with some hacks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Adds the '@' pattern modifier to limit matches to known aliases.

Example: ~f joe matches messages from joe. @~f joe matches messages from
any joe who is defined as an alias.

Pushed by Kevin McCarthy with two minor cosmetic fixes.

+40 -2
+23
doc/manual.xml.head
··· 4359 4359 <command>macro</command>'s commands into its history. 4360 4360 </para> 4361 4361 4362 + <para> 4363 + You can restrict address pattern matching to aliases that you have 4364 + defined with the "@" modifier. This example matches messages whose 4365 + recipients are all from Germany, and who are known to your alias list. 4366 + </para> 4367 + 4368 + <para> 4369 + <screen> 4370 + ^@~C \.de$ 4371 + </screen> 4372 + </para> 4373 + 4374 + <para> 4375 + To match any defined alias, use a regular expression that matches any 4376 + string. This example matches messages whose senders are known aliases. 4377 + </para> 4378 + 4379 + <para> 4380 + <screen> 4381 + @~f . 4382 + </screen> 4383 + </para> 4384 + 4362 4385 </sect3> 4363 4386 4364 4387 </sect2>
+1
mutt.h
··· 860 860 unsigned int stringmatch : 1; 861 861 unsigned int groupmatch : 1; 862 862 unsigned int ign_case : 1; /* ignore case for local stringmatch searches */ 863 + unsigned int isalias : 1; 863 864 int min; 864 865 int max; 865 866 struct pattern_t *next;
+16 -2
pattern.c
··· 783 783 int alladdr = 0; 784 784 int or = 0; 785 785 int implicit = 1; /* used to detect logical AND operator */ 786 + int isalias = 0; 786 787 const struct pattern_flags *entry; 787 788 char *p; 788 789 char *buf; ··· 804 805 case '!': 805 806 ps.dptr++; 806 807 not = !not; 808 + break; 809 + case '@': 810 + ps.dptr++; 811 + isalias = !isalias; 807 812 break; 808 813 case '|': 809 814 if (!or) ··· 830 835 implicit = 0; 831 836 not = 0; 832 837 alladdr = 0; 838 + isalias = 0; 833 839 break; 834 840 case '%': 835 841 case '=': ··· 859 865 last = tmp; 860 866 tmp->not ^= not; 861 867 tmp->alladdr |= alladdr; 868 + tmp->isalias |= isalias; 862 869 not = 0; 863 870 alladdr = 0; 871 + isalias = 0; 864 872 /* compile the sub-expression */ 865 873 buf = mutt_substrdup (ps.dptr + 1, p); 866 874 if ((tmp2 = mutt_pattern_comp (buf, flags, err)) == NULL) ··· 888 896 tmp = new_pattern (); 889 897 tmp->not = not; 890 898 tmp->alladdr = alladdr; 899 + tmp->isalias = isalias; 891 900 tmp->stringmatch = (*ps.dptr == '=') ? 1 : 0; 892 901 tmp->groupmatch = (*ps.dptr == '%') ? 1 : 0; 893 902 not = 0; 894 903 alladdr = 0; 904 + isalias = 0; 895 905 896 906 if (last) 897 907 last->next = tmp; ··· 957 967 last = tmp; 958 968 tmp->not ^= not; 959 969 tmp->alladdr |= alladdr; 970 + tmp->isalias |= isalias; 960 971 not = 0; 961 972 alladdr = 0; 973 + isalias = 0; 962 974 ps.dptr = p + 1; /* restore location */ 963 975 break; 964 976 default: ··· 1010 1022 { 1011 1023 for (a = va_arg (ap, ADDRESS *) ; a ; a = a->next) 1012 1024 { 1013 - if (pat->alladdr ^ ((a->mailbox && patmatch (pat, a->mailbox) == 0) || 1014 - (match_personal && a->personal && patmatch (pat, a->personal) == 0))) 1025 + if (pat->alladdr ^ 1026 + ((!pat->isalias || alias_reverse_lookup (a)) && 1027 + ((a->mailbox && !patmatch (pat, a->mailbox)) || 1028 + (match_personal && a->personal && !patmatch (pat, a->personal) )))) 1015 1029 { 1016 1030 va_end (ap); 1017 1031 return (! pat->alladdr); /* Found match, or non-match if alladdr */