--- hdrs/elm_defs.h.orig 2005-08-18 13:20:14.000000000 +0000 +++ hdrs/elm_defs.h 2007-11-11 11:39:20.000000000 +0000 @@ -105,7 +105,7 @@ #ifndef _SIZE_T /* not the greatest, but should work until I make Configure figure it out */ #define _SIZE_T -typedef unsigned long size_t; +//typedef unsigned long size_t; #endif #define KLICK 32 /* increment for alias and mssg lists */ @@ -423,6 +423,7 @@ long cc_index; /** index in allto of cc fields **/ struct addrs ml_to; /** mlist parsed 'to' fields **/ long ml_cc_index; /** index in ml_to of cc fields **/ + int alias; /** is this name in the alias table -tim **/ }; /** some defines for the "type" field of the alias record **/ --- hdrs/elm_globals.h.orig 2005-08-18 12:49:24.000000000 +0000 +++ hdrs/elm_globals.h 2008-05-03 13:50:09.000000000 +0000 @@ -110,6 +110,7 @@ #define SUBJECT 5 /* the subject of the message */ #define STATUS 6 /* the status (deleted, etc) */ #define MAILBOX_ORDER 7 /* the order it is in the file */ +#define ANTISPAM 8 /* an order useful for finding spam */ /* alias sorting selections */ #define ALIAS_SORT 1 /* the name of the alias */ --- hdrs/s_elm.h.orig 2005-08-18 12:49:24.000000000 +0000 +++ hdrs/s_elm.h 2008-05-03 14:05:30.000000000 +0000 @@ -409,6 +409,8 @@ #define ElmSortSize 0x1d6 #define ElmSortSubject 0x1d7 #define ElmSortStatus 0x1d8 +#define ElmSortRAntiSpam 0x1d9 +#define ElmSortAntiSpam 0x1da #define ElmPressKeyHelp 0x1e6 #define ElmKeyPrompt 0x1e7 #define ElmKeyIsntUsed 0x1e8 @@ -781,3 +783,7 @@ #define ElmArgsNoFileBatch 0x3c1 #define ElmNoRecipientsKeptMessage 0x3c2 #define ElmNoRecipients 0x3c3 +#define ElmAbrRevSpam 0x3d0 +#define ElmLongRevSpam 0x3d1 +#define ElmAbrSpam 0x3d2 +#define ElmLongSpam 0x3d3 --- src/limit.c.orig 2005-08-18 12:49:24.000000000 +0000 +++ src/limit.c 2008-03-11 23:41:35.000000000 +0000 @@ -143,11 +143,11 @@ all++; selected = 0; } - else if (streq(first, "subj") || streq(first, "subject")) + else if (streq(first,"s") || streq(first, "subj") || streq(first, "subject")) selected = limit_selection(SUBJECT, rest, selected); - else if (streq(first, "to")) + else if (streq(first,"t") || streq(first, "to")) selected = limit_selection(TO, rest, selected); - else if (streq(first, "from")) + else if (streq(first,"f") || streq(first, "from")) selected = limit_selection(FROM, rest, selected); else { error1(catgets(elm_msg_cat, ElmSet, ElmLimitNotValidCriterion, --- src/newmbox.c.orig 2005-08-18 13:20:14.000000000 +0000 +++ src/newmbox.c 2007-11-11 12:34:37.000000000 +0000 @@ -678,11 +678,37 @@ } } else if (fast_header_cmp(buffer,"From", (char *)NULL)) { +static int i=0; +char *address[SLEN], comment[SLEN]; buffer[line_bytes - 1] = '\0'; strfcpy(current_header->allfrom, buffer+6, STRING); dprint(1, (debugfile, "\n**** Calling parse_arpa_who for \"From\" ****\n")); parse_arpa_who(buffer+5, current_header->from); +// -tim +//printf("from %s\n",current_header->from); +//printf("allfrom %s\n",current_header->allfrom); +parse_arpa_mailbox(current_header->allfrom,address,sizeof(address), + comment, sizeof(comment),NULL); +if(address_to_alias(address)) { + current_header->alias=1; +} else { + current_header->alias=0; +} + +//printf("%d ret: %s\n",current_header->alias,address); + +//if(address_to_alias(address)) current_header->alias=0 +//current_header->alias=i++%2; + +/* + int parse_arpa_mailbox(buf, ret_addr, len_addr, + * ret_name, len_name, next_field); + * char *buf, *ret_addr, *ret_name, **next_field; + * int len_addr, len_name; + return is 0 for ok. +*/ + } else if (fast_header_cmp(buffer, "Message-Id", (char *)NULL)) { buffer[line_bytes - 1] = '\0'; --- src/options.c.orig 2005-08-18 12:49:24.000000000 +0000 +++ src/options.c 2008-05-03 14:12:12.000000000 +0000 @@ -550,7 +550,8 @@ sortby = - sortby; } else sign = 1; /* insurance! */ - sortby = sign * ((sortby + 1) % (STATUS+2)); + /*sortby = sign * ((sortby + 1) % (STATUS+2));*/ + sortby = sign * ((sortby + 1) % (ANTISPAM+1)); if (sortby == 0) sortby = sign; /* snicker */ PutLine1(x, y, "%-24s", sort_name(TRUE)); sort_one_liner(sortby); @@ -628,6 +629,11 @@ catgets(elm_msg_cat, ElmSet, ElmSortRStatus, "This sort will order by reverse status - Deleted through Tagged...")); break; + case REVERSE ANTISPAM: CenterLine(LINES-2, + catgets(elm_msg_cat, ElmSet, ElmSortRAntiSpam, +"This sort will order by reverse received if known sender or by subject...")); + break; + case SENT_DATE: CenterLine(LINES-2, catgets(elm_msg_cat, ElmSet, ElmSortSentDate, "This sort will order least-recently-sent to most-recently-sent")); @@ -656,6 +662,10 @@ catgets(elm_msg_cat, ElmSet, ElmSortStatus, "This sort will order by status - Tagged through Deleted...")); break; + case ANTISPAM: CenterLine(LINES-2, + catgets(elm_msg_cat, ElmSet, ElmSortAntiSpam, +"This sort will order by subject if unknwn sender then received...")); + break; } } --- src/screen.c.orig 2008-05-03 13:00:39.000000000 +0000 +++ src/screen.c 2007-11-11 12:09:01.000000000 +0000 @@ -515,7 +515,8 @@ subj_width = subj_field_width; /* complete line with sender, length and subject. */ - sprintf(buffer + strlen(buffer), "%-*.*s (%d) %s%-*.*s", +/* -tim add but for a flag of > if whitelisted */ + sprintf(buffer + strlen(buffer), "%-*.*s (%d) %s%s%-*.*s", /* give max and min width parameters for 'from' */ who_width, who_width, @@ -526,8 +527,10 @@ entry->lines / 100 > 0? " " : /* same for the */ entry->lines / 10 > 0? " " : /* lines in () */ " "), /* [wierd] */ + entry->alias?">":" ", - subj_width, subj_width, entry->subject); + subj_width, subj_width, entry->subject); /* subj_width should be -1 -tim */ + } int --- src/sort.c.orig 2005-08-18 12:49:24.000000000 +0000 +++ src/sort.c 2008-05-03 14:07:13.000000000 +0000 @@ -139,6 +139,22 @@ ret = strcmp(from1, from2); break; +// -tim Sort by alias flag 1st... +// if in alias then by name else by subject + case ANTISPAM: // this is by in alias file now alias + if (first->alias == second->alias) { + if(first->alias) { + tail_of(first->from, from1, first->to); + tail_of(second->from, from2, second->to); + ret = strcmp(from1, from2); + } else { + /* we don't care about case or re: filtering here */ + ret = strcmp(first->subject, second->subject); + } + } else + ret = (first->alias - second->alias); + break; + case SIZE: ret = (first->lines - second->lines); break; @@ -217,6 +233,11 @@ "Reverse Message Status") : catgets(elm_msg_cat, ElmSet, ElmAbrRevStatus, "Reverse-Status")); + case ANTISPAM: return (longname + ? catgets(elm_msg_cat, ElmSet, ElmLongRevSpam, + "Reverse AntiSpam Date/Subject") + : catgets(elm_msg_cat, ElmSet, ElmAbrRevSpam, + "Reverse-AntiSpam")); } } else { switch (sortby) { @@ -255,6 +276,11 @@ "Message Status") : catgets(elm_msg_cat, ElmSet, ElmAbrStatus, "Status")); + case ANTISPAM: return (longname + ? catgets(elm_msg_cat, ElmSet, ElmLongSpam, + "AntiSpam Subject/Date") + : catgets(elm_msg_cat, ElmSet, ElmAbrSpam, + "AntiSpam")); } }