2 > static void procmail_query(char *str);
3 > static void procmail_print_email(int item);
5 > if( !strcmp(argv[i], "--procmail-query") )
6 > procmail_query(argv[i + 1]);
11 > procmail_print_email(int item)
13 > char emails[MAX_EMAILS][MAX_EMAIL_LEN];
15 > split_emailstr(item, emails);
17 > if( options_get_int("mutt", "return_all_emails") ) {
19 > for(i=0; i<MAX_EMAILS; i++)
21 > printf("%s\n", emails[i]);
23 > printf("%s\n", emails[0]);
27 < printf("All items\n");
29 > /*printf("All items\n");*/
36 > printf("Not found\n");
44 > procmail_query(char *str)
51 > if( str == NULL || !strcasecmp(str, "all") ) {
52 > /*printf("All items\n");*/
53 > for(i = 0; i < items; i++)
54 > procmail_print_email(i);
56 > for(i = 0, j = 0 ; i < items; i++) {
57 > tmp = strdup(database[i][NAME]);
58 > if( strstr( strupper(tmp), strupper(str) ) != NULL ) {
61 > procmail_print_email(i);