From jason@redline.ru Fri Oct 11 15:09:49 1996 Date: Fri, 11 Oct 1996 15:44:18 +0400 (GMT+0400) From: "Dmitry E. Kim" To: megera@sai.msu.su, jason@comus.ru Subject: patch pine cyrillic diff -rbBc -C 3 pine3.95.orig/pine/init.c pine3.95/pine/init.c *** pine3.95.orig/pine/init.c Thu Jul 11 02:05:31 1996 --- pine3.95/pine/init.c Thu Aug 15 13:54:06 1996 *************** *** 1340,1345 **** --- 1340,1346 ---- {"disable-signature-edit-cmd", F_DISABLE_SIGEDIT_CMD}, {"enable-8bit-esmtp-negotiation", F_ENABLE_8BIT}, {"enable-8bit-nntp-posting", F_ENABLE_8BIT_NNTP}, + {"dont-encode-8bit-text-and-subject", F_DONT_ENCODE}, {"enable-aggregate-command-set", F_ENABLE_AGG_OPS}, {"enable-alternate-editor-cmd", F_ENABLE_ALT_ED}, {"enable-alternate-editor-implicitly", F_ALT_ED_NOW}, diff -rbBc -C 3 pine3.95.orig/pine/makefile.lnx pine3.95/pine/makefile.lnx *** pine3.95.orig/pine/makefile.lnx Fri Aug 16 11:56:15 1996 --- pine3.95/pine/makefile.lnx Wed Aug 14 19:07:51 1996 *************** *** 61,68 **** LOCLIBES= $(PICODIR)/libpico.a $(IMAPDIR)/c-client.a LIBES= $(EXTRALIBES) $(LOCLIBES) $(STDLIBES) STDCFLAGS= -DLNX -DSYSTYPE=\"LNX\" -DMOUSE ! CFLAGS= $(OPTIMIZE) $(PROFILE) $(DEBUG) $(EXTRACFLAGS) $(STDCFLAGS) obj= addrbook.o adrbklib.o args.o context.o filter.o \ folder.o help.o helptext.o imap.o init.o mailcap.o mailcmd.o \ --- 61,69 ---- LOCLIBES= $(PICODIR)/libpico.a $(IMAPDIR)/c-client.a LIBES= $(EXTRALIBES) $(LOCLIBES) $(STDLIBES) + LOCALEFLAGS= -DLC_COLLATE -DLC_CTYPE STDCFLAGS= -DLNX -DSYSTYPE=\"LNX\" -DMOUSE ! CFLAGS= $(OPTIMIZE) $(PROFILE) $(DEBUG) $(EXTRACFLAGS) $(STDCFLAGS) $(LOCALEFLAGS) obj= addrbook.o adrbklib.o args.o context.o filter.o \ folder.o help.o helptext.o imap.o init.o mailcap.o mailcmd.o \ diff -rbBc -C 3 pine3.95.orig/pine/osdep/os-lnx.h pine3.95/pine/osdep/os-lnx.h *** pine3.95.orig/pine/osdep/os-lnx.h Fri Aug 16 12:55:37 1996 --- pine3.95/pine/osdep/os-lnx.h Wed Jun 5 20:13:29 1996 *************** *** 249,255 **** /*----------------- locale.h -------------------------------------------*/ ! #include /* To make matching and sorting work right */ --- 249,255 ---- /*----------------- locale.h -------------------------------------------*/ ! /* #include /* To make matching and sorting work right */ *************** *** 313,324 **** /* #include /* BSD-based systems */ /*--------- System V terminal driver -----------------------------------*/ ! /* #define HAVE_TERMIO /* this is for pure System V */ ! /* #include /* Sys V */ /*--------- POSIX terminal driver --------------------------------------*/ ! #define HAVE_TERMIOS /* this is an alternative */ ! #include /* POSIX */ --- 313,324 ---- /* #include /* BSD-based systems */ /*--------- System V terminal driver -----------------------------------*/ ! #define HAVE_TERMIO /* this is for pure System V */ ! #include /* Sys V */ /*--------- POSIX terminal driver --------------------------------------*/ ! /* #define HAVE_TERMIOS /* this is an alternative */ ! /* #include /* POSIX */ *************** *** 328,334 **** /*-------- Use terminfo database instead of termcap --------------------*/ ! #define USE_TERMINFO /* use terminfo instead of termcap */ --- 328,334 ---- /*-------- Use terminfo database instead of termcap --------------------*/ ! /* #define USE_TERMINFO /* use terminfo instead of termcap */ *************** *** 358,364 **** /*---------------------------------------------------------------------- If no nntp-servers are defined, this program will be used to post news. ----*/ ! #define SENDNEWS "/usr/lib/news/inews -h" /* news posting cmd */ /*--------- Program employed by users to change their password ---------*/ --- 358,364 ---- /*---------------------------------------------------------------------- If no nntp-servers are defined, this program will be used to post news. ----*/ ! /* #define SENDNEWS "/usr/local/bin/inews -h" /* news posting cmd */ /*--------- Program employed by users to change their password ---------*/ diff -rbBc -C 3 pine3.95.orig/pine/other.c pine3.95/pine/other.c *** pine3.95.orig/pine/other.c Thu Jul 11 02:05:59 1996 --- pine3.95/pine/other.c Thu Aug 15 15:38:29 1996 *************** *** 2484,2489 **** --- 2484,2491 ---- return(h_config_cruise_mode_delete); case F_ALLOW_GOTO : return(h_config_allow_goto); + case F_DONT_ENCODE: + return(h_config_dont_encode); default : return(NO_HELP); } diff -rbBc -C 3 pine3.95.orig/pine/pine.h pine3.95/pine/pine.h *** pine3.95.orig/pine/pine.h Thu Jul 11 21:15:44 1996 --- pine3.95/pine/pine.h Thu Aug 15 12:38:23 1996 *************** *** 1153,1159 **** #define F_FROM_DELIM_IN_PRINT 80 #define F_BACKGROUND_POST 81 #define F_ALLOW_GOTO 82 ! #define F_LAST_FEATURE 82 /* RESET WITH NEW FEATURES */ #if (F_LAST_FEATURE > (LARGEST_BITMAP - 1)) Whoa! Too many features! --- 1153,1160 ---- #define F_FROM_DELIM_IN_PRINT 80 #define F_BACKGROUND_POST 81 #define F_ALLOW_GOTO 82 ! #define F_DONT_ENCODE 83 ! #define F_LAST_FEATURE 83 /* RESET WITH NEW FEATURES */ #if (F_LAST_FEATURE > (LARGEST_BITMAP - 1)) Whoa! Too many features! diff -rbBc -C 3 pine3.95.orig/pine/pine.hlp pine3.95/pine/pine.hlp *** pine3.95.orig/pine/pine.hlp Fri Jun 21 03:45:20 1996 --- pine3.95/pine/pine.hlp Thu Aug 15 16:29:45 1996 *************** *** 363,368 **** --- 363,369 ---- o disable-signature-edit-cmd o enable-8bit-esmtp-negotiation o enable-8bit-nntp-posting + o dont-encode-8bit-text-and-subject o enable-cruise-mode (SPACE acts like tab when at end of msg) o enable-cruise-mode-delete (look at it once, then it disappears) o enable-dot-files (file browser normally hides dot files) *************** *** 5478,5483 **** --- 5479,5495 ---- characters is to leave Pine's MIME encoding turned on, but recipients who lack MIME-aware tools are often annoyed when they receive MIME-encoded messages. + + + ====== h_config_dont_encode ===== + FEATURE: dont-encode-8bit-text-and-subject + + This feature forces Pine to send message header and body \"as-is\", i.e + unencoded, even if it does contain non-ascii characters. This way the + in-country mail goes in former USSR. May be it's against the rules, but... + + So, this feature has to be set if you do use Pine within ex-USSR with + koi-8r charset. Unset it otherwise... ====== h_config_tab_new_only ===== diff -rbBc -C 3 pine3.95.orig/pine/send.c pine3.95/pine/send.c *** pine3.95.orig/pine/send.c Mon Jul 8 21:10:50 1996 --- pine3.95/pine/send.c Wed Aug 21 12:15:10 1996 *************** *** 4131,4136 **** --- 4131,4141 ---- * it from getting encoded in "pine_rfc822_output_body" by * temporarily inventing a synonym for ENC8BIT... */ + + /* Changed for incorporating F_DONT_ENCODE */ + if (F_OFF(F_DONT_ENCODE, ps_global)){ + /* */ + if(bp && sending_stream->ok_8bitmime){ int i; *************** *** 4146,4151 **** --- 4151,4160 ---- } } + /* End if block for the above change */ + } + /* */ + TIME_STAMP("smtp start", 1); if(!error_mess && !smtp_mail(sending_stream, "MAIL", fake_env ? fake_env : header->env, body)){ *************** *** 4186,4195 **** --- 4195,4212 ---- error_mess = error_buf; } + /* Changed for incorporating F_DONT_ENCODE */ + if (F_OFF(F_DONT_ENCODE, ps_global)){ + /* */ + /* repair modified "body_encodings" array? */ if(bp && sending_stream->ok_8bitmime) body_encodings[bp->encoding] = NULL; + /* End if block for the above change */ + } + /* */ + TIME_STAMP("smtp closing", 1); smtp_close(sending_stream); sending_stream = NULL; *************** *** 5497,5504 **** *(p = tmp) = '\0'; rfc822_header_line(&p, field, header ? header->env : NULL, rfc1522_encode(tmp_20k_buf, (unsigned char *) text, ! ps_global->VAR_CHAR_SET)); return(((writehdr && f) ? (*f)(s, tmp) : 1) && ((localcopy && local_so && !local_written) ? so_puts(local_so,tmp) : 1)); --- 5515,5531 ---- *(p = tmp) = '\0'; rfc822_header_line(&p, field, header ? header->env : NULL, + + /* Changed to disable header encoding */ + F_OFF(F_DONT_ENCODE, ps_global) ? + rfc1522_encode(tmp_20k_buf, (unsigned char *) text, ! ps_global->VAR_CHAR_SET) ! ! : text ); ! /* Changes end here */ ! ! return(((writehdr && f) ? (*f)(s, tmp) : 1) && ((localcopy && local_so && !local_written) ? so_puts(local_so,tmp) : 1)); *************** *** 5540,5548 **** } ptmp = alist->personal; /* remember personal name */ ! alist->personal = rfc1522_encode(tmp_20k_buf, (unsigned char *) alist->personal, ! ps_global->VAR_CHAR_SET); pruned = prune_personal(alist, &ch); atmp = alist->next; alist->next = NULL; /* digest only first address! */ --- 5567,5584 ---- } ptmp = alist->personal; /* remember personal name */ ! ! /* Changed to disable header encoding */ ! alist->personal = ! F_OFF(F_DONT_ENCODE, ps_global) ? ! ! rfc1522_encode(tmp_20k_buf, (unsigned char *) alist->personal, ! ps_global->VAR_CHAR_SET) ! ! : alist->personal; ! /* Changes end here */ ! pruned = prune_personal(alist, &ch); atmp = alist->next; alist->next = NULL; /* digest only first address! */ *************** *** 5617,5625 **** tmp[0] = '\0'; ptmp = alist->personal; /* remember personal name */ ! alist->personal = rfc1522_encode(tmp_20k_buf, (unsigned char *) alist->personal, ! ps_global->VAR_CHAR_SET); pruned = prune_personal(alist, &ch); atmp = alist->next; alist->next = NULL; /* tie off linked list */ --- 5653,5670 ---- tmp[0] = '\0'; ptmp = alist->personal; /* remember personal name */ ! ! /* Changed to disable header encoding */ ! alist->personal = ! F_OFF(F_DONT_ENCODE, ps_global) ? ! ! rfc1522_encode(tmp_20k_buf, (unsigned char *) alist->personal, ! ps_global->VAR_CHAR_SET) ! ! : alist->personal; ! /* Changes end here */ ! pruned = prune_personal(alist, &ch); atmp = alist->next; alist->next = NULL; /* tie off linked list */ *************** *** 6084,6093 **** --- 6129,6148 ---- switch (body->encoding) { /* all else needs filtering */ case ENC8BIT: /* encode 8BIT into QUOTED-PRINTABLE */ + + /* Added to allow F_DONT_ENCODE */ + if ((F_OFF(F_DONT_ENCODE, ps_global)) || (body->type != TYPETEXT)) + /* Changes end here */ + gf_link_filter(gf_8bit_qp); break; case ENCBINARY: /* encode binary into BASE64 */ + + /* Added to allow F_DONT_ENCODE */ + if ((F_OFF(F_DONT_ENCODE, ps_global)) || (body->type != TYPETEXT)) + /* Changes end here */ + gf_link_filter(gf_binary_b64); break; *************** *** 6137,6146 **** sprintf (*dst += strlen (*dst),"; %s=",param->attribute); rfc822_cat (*dst,param->value,tspecials); } while (param = param->next); ! else if (body->type == TYPETEXT) strcat (*dst,"; charset=US-ASCII"); strcpy (*dst += strlen (*dst),"\015\012"); if (body->encoding) /* note: encoding 7BIT never output! */ sprintf (*dst += strlen (*dst), "Content-Transfer-Encoding: %s\015\012", body_encodings[(body->encoding == ENCBINARY) ? ENCBASE64 : (body->encoding == ENC8BIT) --- 6192,6221 ---- sprintf (*dst += strlen (*dst),"; %s=",param->attribute); rfc822_cat (*dst,param->value,tspecials); } while (param = param->next); ! else if (body->type == TYPETEXT) ! ! /* Changed to insert right charset when F_DONT_ENCODE is set */ ! { ! /* strcat (*dst,"; charset=US-ASCII"); /* The only string from original file */ ! ! strcat (*dst,"; charset="); ! ! if (body->encoding && (F_ON(F_DONT_ENCODE, ps_global))) ! strcat (*dst,ps_global->VAR_CHAR_SET ? ps_global->VAR_CHAR_SET ! : (getenv("LANG") ? getenv("LANG") : "koi8-r")); ! else ! strcat (*dst,"US-ASCII"); ! } ! /* Changes end here */ ! strcpy (*dst += strlen (*dst),"\015\012"); if (body->encoding) /* note: encoding 7BIT never output! */ sprintf (*dst += strlen (*dst), "Content-Transfer-Encoding: %s\015\012", + + /* Added to substitute encoding "8-bit" for a text when F_DONT_ENCODE is set */ + (F_ON(F_DONT_ENCODE, ps_global) && (body->type == TYPETEXT)) ? "8-bit" : + /* Changes end here */ + body_encodings[(body->encoding == ENCBINARY) ? ENCBASE64 : (body->encoding == ENC8BIT) *************** *** 6341,6346 **** --- 6417,6426 ---- * Fake that we've got clearance from the transport agent * for 8bit transport for the benefit of our output routines... */ + + /* Changed for incorporating F_DONT_ENCODE */ + if (F_OFF(F_DONT_ENCODE, ps_global)){ + /* */ if(F_ON(F_ENABLE_8BIT_NNTP, ps_global) && (bp = first_text_8bit(body))){ int i; *************** *** 6357,6362 **** --- 6437,6446 ---- } } + /* End if block for the above change */ + } + /* */ + /* * Set global header pointer so we can get at it later... */ *************** *** 6368,6375 **** --- 6452,6468 ---- smtp_close(sending_stream); sending_stream = NULL; + + /* Changed for incorporating F_DONT_ENCODE */ + if (F_OFF(F_DONT_ENCODE, ps_global)){ + /* */ + if(F_ON(F_ENABLE_8BIT_NNTP, ps_global) && bp) body_encodings[bp->encoding] = NULL; + + /* End if block for the above change */ + } + /* */ } else { /*---- Open of NNTP connection failed ------ */