This patch is against Pine version 3.96, available from ftp.cac.washington.edu. This patch is released under the terms of the GNU GPL version 2. There is NO WARRANTY, express or implied, to the extent permitted by applicable law. The patch is provided "as is", and the entire risk of quality, performance, and fitness for a particular purpose is with the user of this patch. Having said that, I use a patched version of Pine every day and it runs fine. Dave Holland December 1997. diff -u -r pine-3.96-orig/pine/help.c pine-3.96/pine/help.c --- pine-3.96-orig/pine/help.c Tue Dec 2 18:06:14 1997 +++ pine-3.96/pine/help.c Sat Nov 22 18:15:35 1997 @@ -360,13 +360,17 @@ /* Add a page break every so often. This is stupid in that * it adds a page break even if there are no more lines. */ + #if 0 /* kill the line breaks */ if(inc_line_cnt++ % lines_to_use == 0) { /* this is a big long string, don't delete part of it */ line = " ___----"; }else { + #endif line = fgets(line_buf, sizeof(line_buf), file); + #if 0 } - if(line == NULL) { + #endif + if(line == NULL) { fclose(file); in_include = 0; continue; diff -u -r pine-3.96-orig/pine/init.c pine-3.96/pine/init.c --- pine-3.96-orig/pine/init.c Tue Dec 2 18:06:16 1997 +++ pine-3.96/pine/init.c Sat Nov 22 18:15:36 1997 @@ -4301,7 +4301,7 @@ folder_base); delete_old: - delete_old_mail(mail_list, prune_cntxt, type); + /* delete_old_mail(mail_list, prune_cntxt, type); */ if(sm = mail_list){ while(sm->name){ fs_give((void **)&(sm->name)); @@ -4323,6 +4323,7 @@ type -- label indicating type of folders being deleted ----*/ +#if 0 void delete_old_mail(sml, fcc_cntxt, type) struct sm_folder *sml; @@ -4359,3 +4360,4 @@ } } } +#endif /* 0 */ diff -u -r pine-3.96-orig/pine/mailcmd.c pine-3.96/pine/mailcmd.c --- pine-3.96-orig/pine/mailcmd.c Tue Dec 2 18:06:18 1997 +++ pine-3.96/pine/mailcmd.c Sat Nov 22 18:15:37 1997 @@ -826,9 +826,9 @@ mn_get_total(msgmap), cur_msgno, del_count)); old_max_msgno = mn_get_total(msgmap); - StartInverse(); + /* StartInverse(); */ StartTbColours(); PutLine0(0, 0, "**"); /* indicate delay */ - EndInverse(); + /* EndInverse(); */ StartTbColours(); MoveCursor(state->ttyo->screen_rows -FOOTER_ROWS(state), 0); fflush(stdout); @@ -873,9 +873,9 @@ sort_current_folder(1, mn_get_sort(msgmap),mn_get_revsort(msgmap)); cur_msgno = mn_get_cur(msgmap); - StartInverse(); + /* StartInverse(); */ StartTbColours(); PutLine0(0, 0, " "); /* indicate delay's over */ - EndInverse(); + /* EndInverse(); */ EndTbColours(); fflush(stdout); if(state->expunge_count > 0) { q_status_message3(SM_ORDER, 3, 3, diff -u -r pine-3.96-orig/pine/mailview.c pine-3.96/pine/mailview.c --- pine-3.96-orig/pine/mailview.c Tue Dec 2 18:06:21 1997 +++ pine-3.96/pine/mailview.c Tue Dec 2 18:09:37 1997 @@ -48,6 +48,7 @@ #include "headers.h" +#include /*---------------------------------------------------------------------- Saved state for scrolling text @@ -355,6 +356,7 @@ */ use_viewer = 0; a->can_display = (body->type == TYPETEXT + /* show text/plain, dammit */ && !strucmp(body->subtype, "plain") && !named) ? CD_DEFERRED : (mime_can_display(body->type, body->subtype, @@ -365,10 +367,11 @@ a->use_external_viewer = use_viewer; a->shown = (((body->type == TYPETEXT - && ((!(*prefix && strcmp(prefix, "1.")) && num == 1) - || !(named || use_viewer))) + /* && ((!(*prefix && strcmp(prefix, "1.")) && num == 1) + || !(named || use_viewer)) */ ) + /* yes, I do want to see text/plain */ || (body->type == TYPEMESSAGE - && body->encoding <= ENCBINARY)) + && body->encoding <= ENCBINARY)) && a->can_display != CD_NOCANDO && should_show); a->number = (char *)fs_get((strlen(prefix) + 16)* sizeof(char)); @@ -970,6 +973,24 @@ char *prefix; { register int i; + + static int my_last_msgno=0; /* track last message */ + static char *my_last_field=NULL; + + if(my_last_field==NULL) { + my_last_field=malloc(100); /* ick! */ + *my_last_field=(char)0; + } + + dprint(1, (debugfile, "format_env_hdr(field=%s, my_last_field=%s)\n", + field, my_last_field)); /* djh */ + + /* Try hard not to duplicate effort on same field in same message. */ + /* This helps the display of messages containing multiple To: lines. */ + if((msgno==my_last_msgno) && (!strucmp(field,my_last_field))) return; + + my_last_msgno=msgno; + strcpy(my_last_field,field); for(i = 0; envelope_hdrs[i].name; i++) if(!strucmp(field, envelope_hdrs[i].name)){ diff -u -r pine-3.96-orig/pine/makefile.lnx pine-3.96/pine/makefile.lnx --- pine-3.96-orig/pine/makefile.lnx Mon Jun 17 20:13:25 1996 +++ pine-3.96/pine/makefile.lnx Thu May 15 14:03:47 1997 @@ -50,7 +50,7 @@ RM= rm -f LN= ln -s MAKE= make -OPTIMIZE= # -O2 +OPTIMIZE= -O2 PROFILE= # -pg DEBUG= -g -DDEBUG @@ -61,7 +61,7 @@ LOCLIBES= $(PICODIR)/libpico.a $(IMAPDIR)/c-client.a LIBES= $(EXTRALIBES) $(LOCLIBES) $(STDLIBES) -STDCFLAGS= -DLNX -DSYSTYPE=\"LNX\" -DMOUSE +STDCFLAGS= -DLNX -DSYSTYPE=\"LNX\" # -DMOUSE CFLAGS= $(OPTIMIZE) $(PROFILE) $(DEBUG) $(EXTRACFLAGS) $(STDCFLAGS) obj= addrbook.o adrbklib.o args.o context.o filter.o \ diff -u -r pine-3.96-orig/pine/newmail.c pine-3.96/pine/newmail.c --- pine-3.96-orig/pine/newmail.c Tue Dec 2 18:06:23 1997 +++ pine-3.96/pine/newmail.c Sat Nov 22 18:15:40 1997 @@ -127,7 +127,7 @@ if(!check_point(time_for_check_point == 0 ? GoodTime: time_for_check_point == 1 ? BadTime : VeryBadTime) && checknow){ if(F_ON(F_SHOW_DELAY_CUE, ps_global) && !ps_global->in_init_seq){ - StartInverse(); + /* StartInverse(); */ StartTbColours(); PutLine0(0, 1, "*"); /* Show something to indicate delay */ MoveCursor(ps_global->ttyo->screen_rows -FOOTER_ROWS(ps_global),0); fflush(stdout); @@ -148,7 +148,7 @@ #endif if(F_ON(F_SHOW_DELAY_CUE, ps_global) && !ps_global->in_init_seq){ PutLine0(0, 1, " "); - EndInverse(); + /* EndInverse(); */ EndTbColours(); fflush(stdout); } } @@ -156,7 +156,7 @@ if(checknow && pine_state->inbox_stream && stream != pine_state->inbox_stream){ if(F_ON(F_SHOW_DELAY_CUE, ps_global)){ - StartInverse(); + /* StartInverse(); */ StartTbColours(); PutLine0(0, 1, "*"); /* Show something to indicate delay */ MoveCursor(ps_global->ttyo->screen_rows -FOOTER_ROWS(ps_global),0); fflush(stdout); @@ -175,7 +175,7 @@ #endif if(F_ON(F_SHOW_DELAY_CUE, ps_global)){ PutLine0(0, 1, " "); - EndInverse(); + /* EndInverse(); */ EndTbColours(); fflush(stdout); } } @@ -507,7 +507,7 @@ ctime(&now), now - first_status_change)); #endif if(F_ON(F_SHOW_DELAY_CUE, ps_global)){ - StartInverse(); + /* StartInverse(); */ StartTbColours(); PutLine0(0, 0, "**"); /* Show something indicate delay*/ MoveCursor(ps_global->ttyo->screen_rows -FOOTER_ROWS(ps_global),0); fflush(stdout); @@ -523,7 +523,7 @@ first_status_change = time(0); if(F_ON(F_SHOW_DELAY_CUE, ps_global)){ PutLine0(0, 0, " "); - EndInverse(); + /* EndInverse(); */ EndTbColours(); fflush(stdout); } diff -u -r pine-3.96-orig/pine/osdep/os-lnx.h pine-3.96/pine/osdep/os-lnx.h --- pine-3.96-orig/pine/osdep/os-lnx.h Mon Jun 17 21:28:56 1996 +++ pine-3.96/pine/osdep/os-lnx.h Sun Jul 21 11:21:24 1996 @@ -351,9 +351,9 @@ /*----- The usual sendmail configuration for sending mail on Unix ------*/ #define SENDMAIL "/usr/sbin/sendmail" -#define SENDMAILFLAGS "-bs -odb -oem" /* send via smtp with backgroud +/*#define SENDMAILFLAGS "-bs -odb -oem" /* send via smtp with backgroud delivery and mail back errors */ - +#define SENDMAILFLAGS "-oi -oem -t" /*---------------------------------------------------------------------- If no nntp-servers are defined, this program will be used to post news. diff -u -r pine-3.96-orig/pine/pine.hlp pine-3.96/pine/pine.hlp --- pine-3.96-orig/pine/pine.hlp Tue Dec 2 18:06:33 1997 +++ pine-3.96/pine/pine.hlp Sat Nov 22 18:15:45 1997 @@ -877,32 +877,59 @@ | (7) LEGAL NOTICES | --------------------- -Pine and Pico are trademarks of the University of Washington. No -commercial use of these trademarks may be made without prior written -permission of the University of Washington. - -Pine and Pico software and its included text are Copyright 1989-1997 by -the University of Washington. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee to the University of -Washington is hereby granted, provided that these legal notices appear in -all copies and supporting documentation, that the name \"Pine\" is retained, -and that the name of the University of Washington is not used in -advertising or publicity pertaining to distribution of the software -without specific, written prior permission. This software is made -available \"as is\". - -Although the above trademark and copyright restrictions do not convey the -right to redistribute derivative works, the University of Washington -encourages unrestricted distribution of patch files which can be applied -to the University of Washington Pine distribution. - -If this software is modified for local use, please denote this on all -modified versions of the software by appending the letter \"L\" to the -current version number and by enumerating the changes in the release notes -and associated documentation. - +This copy of Pine has been modified from the original sources: + - it incorporates the LUPINE message-ID patch by Dan + Sheppard, distributed under the GPL version 2 + - the listing of MIME parts in the message-ID has been compressed + - pine will never to offer to delete old mail folders + - some use of colour (status bar and messages) under xterm and Linux + console + - attachments of type 'text/plain' are shown in the message viewer + rather than having to be explicitly chosen + - the bug with multiple To: or Cc: lines has been fixed + +All changes except the first are the work of Dave Holland + + +Pine and Pico are registered trademarks of the University of Washington. +No commercial use of these trademarks may be made without prior written +permission of the University of Washington. + +Pine, Pico, and Pilot software and its included text are Copyright +1989-1996 by the University of Washington. + +Use of Pine/Pico/Pilot: You may compile and execute these programs for +any purpose, including commercial, without paying anything to the +University of Washington, provided that the legal notices are maintained +intact and honored. + +Local modification of this release is permitted as follows, or by mutual +agreement: In order to reduce confusion and facilitate debugging, we +request that locally modified versions be denoted by appending the letter +\"L\" to the current version number, and that the local changes be +enumerated in the integral release notes and associated documentation. + +Redistribution of this release is permitted as follows, or by mutual +agreement: + (a) In free-of-charge or at-cost distributions by non-profit concerns; + (b) In free-of-charge distributions by for-profit concerns; + (c) Inclusion in a CD-ROM collection of free-of-charge, shareware, or + non-proprietary software for which a fee may be charged for the + packaged distribution. + +UW encourages unrestricted distribution of individual patches to the Pine +system. By \"patches\" we mean \"difference\" files that can be applied +to the UW Pine source distribution in order to accomplish bug fixes, minor +enhancements, or adaptation to new operating systems. Submission of these +patches to UW for possible inclusion in future Pine versions is also +encouraged. + +The above permissions are hereby granted, provided that the Pine and Pico +copyright and trademark notices appear in all copies and that both the +above copyright notice and this permission notice appear in supporting +documentation, and that the name of the University of Washington not be +used in advertising or publicity pertaining to distribution of the +software without specific, prior written permission. This software is +made available \"as is\", and + THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN @@ -990,7 +1017,7 @@ | Local Support Contacts | -------------------------- -___include /usr/local/lib/pine.info +___include /usr/local/lib/pine-info [ No local information available. ] diff -u -r pine-3.96-orig/pine/reply.c pine-3.96/pine/reply.c --- pine-3.96-orig/pine/reply.c Mon Mar 25 08:04:22 1996 +++ pine-3.96/pine/reply.c Wed Jul 24 19:28:50 1996 @@ -58,6 +58,8 @@ The evolution continues... =====*/ + /* This file modified with LUPINE patches, DP Sheppard Oct 1995 + Distributed under GPL v2 */ #include "headers.h" @@ -100,6 +102,12 @@ #define PART_SO_TYPE CharStar #endif +/* LUPINE */ +#define MSGID_ENCODE "#$%&*+-/0123456789=?^_abcdefghijklmnopqrstuvwxyz{}~" +#define MSGID_BASE (strlen(MSGID_ENCODE)) +const char msgid_digit[]=MSGID_ENCODE; +/* LUPINE */ + /*---------------------------------------------------------------------- @@ -662,7 +670,7 @@ else so_puts((STORE_S *)msgtext, NEWLINE); - so_puts((STORE_S *)msgtext, NEWLINE); + /* so_puts((STORE_S *)msgtext, NEWLINE); */ /* extraneous nl */ } if(totalm > 1L){ @@ -1225,7 +1233,8 @@ } gf_puts(NEWLINE, pc); /* and end with two newlines */ - gf_puts(NEWLINE, pc); + /* gf_puts(NEWLINE, pc); */ /* only one -- then included text follows + immediately after attribution */ } @@ -2478,12 +2487,38 @@ Uniqueness is gaurenteed by using the host name, process id, date to the second and a single unique character *----------------------------------------------------------------------*/ + +void convbase(c,num,dig,base) + char *c; + int num,dig,base; +{ + if(num>=base) + convbase(c,num/base,dig-1,base); + c[dig]=msgid_digit[num%base]; +} +char * +tobase(n,d,b) + int n,d,b; +{ + char *c; + int i; + + c=(char *)malloc((d+1)*sizeof(char)); + for(i=0;i!=d;i++) c[i]=msgid_digit[0]; + c[d]='\0'; + convbase(c,n,d-1,b); + return(c); +} + +#define timenum(mo,da,ho,mi,se) ((se)+60*((mi)+60*((ho)+24*((da)+32*(mo))))) + + char * generate_message_id(ps) struct pine *ps; { - static char a = 'A'; - char *id; + static char a = 0; + char *id,*i,*j; time_t now; struct tm *now_x; @@ -2491,12 +2526,20 @@ now_x = localtime(&now); id = (char *)fs_get(128 * sizeof(char)); - sprintf(id,"", - SYSTYPE, pine_version, now_x->tm_year, now_x->tm_mon + 1, - now_x->tm_mday, now_x->tm_hour, now_x->tm_min, now_x->tm_sec, - getpid(), a, ps->hostname); + sprintf(id,"<%.4s%.5s%c$@%.50s>", + i=tobase(getpid()+(32768*(now_x->tm_year&127)),4,MSGID_BASE), + j=tobase(timenum(now_x->tm_mon, + now_x->tm_mday, + now_x->tm_hour, + now_x->tm_min, + now_x->tm_sec) ,5,MSGID_BASE), + msgid_digit[a], + ps->hostname); + free(i); + free(j); + a+=2; + a%=MSGID_BASE; - a = (a == 'Z') ? 'a' : (a == 'z') ? 'A' : a + 1; return(id); } diff -u -r pine-3.96-orig/pine/screen.c pine-3.96/pine/screen.c --- pine-3.96-orig/pine/screen.c Wed May 8 02:05:40 1996 +++ pine-3.96/pine/screen.c Thu May 15 13:58:58 1997 @@ -51,6 +51,8 @@ #include "headers.h" +extern char term_name[]; /* from ttyout.c -- djh */ + /* * Internal prototypes */ @@ -862,9 +864,9 @@ tb = format_titlebar(&start_col); if(display_on_screen){ - StartInverse(); + /* StartInverse(); */ StartTbColours(); PutLine0(0, start_col, tb+start_col); - EndInverse(); + /* EndInverse(); */ EndTbColours(); fflush(stdout); } @@ -877,10 +879,10 @@ int start_col; char *tb; - StartInverse(); + /* StartInverse(); */ StartTbColours(); tb = format_titlebar(&start_col); PutLine0(0, start_col, tb+start_col); - EndInverse(); + /* EndInverse(); */ EndTbColours(); fflush(stdout); } @@ -1113,7 +1115,7 @@ delta = digit_count(mn_get_cur(as.msgmap)) - digit_count(as.current_msg); - StartInverse(); + /* StartInverse(); */ StartTbColours(); if(delta) { as.current_msg = mn_get_cur(as.msgmap); @@ -1142,7 +1144,7 @@ PutLine0(0, as.cur_mess_col, comatose(as.current_msg)); } - EndInverse(); + /* EndInverse(); */ EndTbColours(); fflush(stdout); } @@ -1184,9 +1186,9 @@ return; as.msg_state = STATUS_BITS(mc); - StartInverse(); + /* StartInverse(); */ StartTbColours(); PutLine0(0, as.del_column, BAR_STATUS(as.msg_state)); - EndInverse(); + /* EndInverse(); */ EndTbColours(); fflush(stdout); } @@ -1206,10 +1208,10 @@ if(as.percent_column < 0) return; - StartInverse(); + /* StartInverse(); */ StartTbColours(); PutLine0(0, as.percent_column, percentage(as.current_line = line, as.total_lines, 0)); - EndInverse(); + /* EndInverse(); */ EndTbColours(); fflush(stdout); } @@ -1235,9 +1237,9 @@ digit_count(as.total_lines), as.current_line, digit_count(as.total_lines), as.total_lines, percentage(as.current_line, as.total_lines, 0)); - StartInverse(); + /* StartInverse(); */ StartTbColours(); PutLine0(0, as.page_column, tmp_20k_buf); - EndInverse(); + /* EndInverse(); */ EndTbColours(); fflush(stdout); } diff -u -r pine-3.96-orig/pine/send.c pine-3.96/pine/send.c --- pine-3.96-orig/pine/send.c Tue Dec 2 18:06:35 1997 +++ pine-3.96/pine/send.c Sat Nov 22 18:15:46 1997 @@ -5029,13 +5029,21 @@ mc.video_parts = min(8, mc.video_parts ); - id[0] = encode_bits(mc.text_parts); +/* hack by Dave Holland to avoid the + "...-100000@..." nastiness */ +/* id[0] = encode_bits(mc.text_parts); id[1] = encode_bits(mc.message_parts); id[2] = encode_bits(mc.application_parts); id[3] = encode_bits(mc.video_parts); id[4] = encode_bits(mc.audio_parts); id[5] = encode_bits(mc.image_parts); id[6] = '\0'; +*/ + id[0] = encode_bits(mc.text_parts + mc.message_parts + + mc.application_parts + mc.video_parts + + mc.audio_parts + mc.image_parts); + id[1] = '\0'; + return(id); } diff -u -r pine-3.96-orig/pine/status.c pine-3.96/pine/status.c --- pine-3.96-orig/pine/status.c Tue Dec 2 18:06:36 1997 +++ pine-3.96/pine/status.c Sat Nov 22 18:15:47 1997 @@ -656,7 +656,7 @@ int column, start_col; if(invert) - StartInverse(); + /* StartInverse(); */ StartStColours(); q = prevstatusbuff; p = obuff; @@ -694,7 +694,7 @@ } if(invert) - EndInverse(); + EndStColours(); /* EndInverse(); */ /* move cursor to a consistent position */ MoveCursor(row, 0); @@ -703,11 +703,11 @@ else{ ClearLine(row); if(invert) - StartInverse(); + /* StartInverse(); */ StartStColours(); col = Centerline(row, obuff); if(invert) - EndInverse(); + /* EndInverse(); */ EndStColours(); MoveCursor(row, 0); fflush(stdout); @@ -806,14 +806,14 @@ if(prevstartcol >= 0 && (l = strlen(prevstatusbuff))){ MoveCursor(ps_global->ttyo->screen_rows - FOOTER_ROWS(ps_global), prevstartcol ? max(prevstartcol - 1, 0) : 0); - StartInverse(); + /* StartInverse(); */ StartStColours(); Write_to_screen(on ? "[>" : " ["); - EndInverse(); + /* EndInverse(); */ EndStColours(); MoveCursor(ps_global->ttyo->screen_rows - FOOTER_ROWS(ps_global), min(prevstartcol + l, ps_global->ttyo->screen_cols) - 1); - StartInverse(); + /* StartInverse(); */ StartStColours(); Write_to_screen(on ? "<]" : "] "); - EndInverse(); + /* EndInverse(); */ EndStColours(); MoveCursor(ps_global->ttyo->screen_rows - FOOTER_ROWS(ps_global), 0); } diff -u -r pine-3.96-orig/pine/ttyout.c pine-3.96/pine/ttyout.c --- pine-3.96-orig/pine/ttyout.c Tue Dec 2 18:06:37 1997 +++ pine-3.96/pine/ttyout.c Sat Nov 22 18:15:47 1997 @@ -1856,6 +1856,45 @@ #endif /* !_WINDOWS */ #endif /* DOS -- End of giant ifdef for DOS drivers */ +/* StartTbColours() and EndTbColours() -- compiled in title bar + * colour scheme -- Dave Holland + */ + +void StartTbColours() +{ +if(!strucmp(term_name,"linux") || !strucmp(term_name,"xterm")) + printf("\033[1m\033[33m\033[44m"); /* bright yellow on blue */ +else + StartInverse(); +} + +void EndTbColours() +{ +if(!strucmp(term_name,"linux") || !strucmp(term_name,"xterm")) + printf("\033[m"); /* reset defaults */ +else + EndInverse(); +} + +/* StartStColours() and EndStColours() -- compiled in status message + * colour scheme -- Dave Holland + */ + +void StartStColours() +{ +if(!strucmp(term_name,"linux") || !strucmp(term_name,"xterm")) + printf("\033[37m\033[41m"); /* white on red */ +else + StartInverse(); +} + +void EndStColours() +{ +if(!strucmp(term_name,"linux") || !strucmp(term_name,"xterm")) + printf("\033[m"); /* reset defaults */ +else + EndInverse(); +} /* * Generic tty output routines...